0

I've got a site that uses Django as a backend and Nuxt for frontend. I'd like to implement the commonly-seen "Remember Me" checkbox when a user logs in. If unchecked, the user should only be logged in for that session and has to log in again the next time they open their browser. If checked, they should stay logged in indefinitely unless they manually log out.

The backend is using Django, with Django Rest Framework and Djoser for authentication. Currently using DRF's TokenAuthentication, and not JWT stuff.

The frontend is using Nuxt, which is using the Nuxt Auth module with the local strategy for logging in. This is saving the token in localStorage, which never expires.

How would I go about adding this "Remember Me" functionality? I'm not even sure which part to modify - either the backend or the frontend.

  • If you have a cookie, then you can have the checkbox checked. If you have the cookie, you can also automatically send a request to auto-authenticate the user with the available info in the cookie. If you don't, no authentication and the checkbox is not checked. – kissu Dec 15 '22 at 22:37

0 Answers0