open-ecommerce-api / store-engine

An ecommerce backend-API created using Django and DRF (Django Rest Framework).
GNU General Public License v3.0
13 stars 10 forks source link

User session logout #96

Closed aminm08 closed 1 year ago

aminm08 commented 1 year ago

We are using both TokenAuthentication and Session Authentication methods to authenticate users. this allows both browser-based clients and non-browser clients (which typically use token authentication) to access the API.

But, in the logging out process at the Logout endpoint, we are only deleting the user's token which is only for logging token authentication out. We also need to logout the client's sessions if the client is using session auth

This can be done by Django's built-in function logout which can be imported from django.contrib.auth

zamaniamin commented 1 year ago

That's true, thanks