Would it be possible to have a "Remember me" feature ? #54
-
Currently, when using this library, after you close the browser entirely, the cookies remain in the cache. Then next time you open the browser and try to access a page with authentication, the cookies are cleared and the user is unAuthenticated => this is great. However, do you think it would be possible to have a "Remember me" option at login, so that when after the browser is fully closed, when the user comes back he could stay authenticated. We would have to manually instantiate firebase/auth and create the "CurrentUser" using a refreshed security token from the cookie session ... but @kmjennison is it possible ? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@tlays In this package, the Firebase JS SDK is the source of truth for auth, so the cookies will set/unset depending on Firebase's auth status. Indefinite authentication: By default, Firebase should persist authentication locally that lives beyond the session (see Firebase persistence docs). If you're signed out after closing the session, you probably have to look at your Firebase settings or ensure your browser isn't clearing local storage on close. Session authentication: If you set Firebase JS SDK to session storage, you should also make sure |
Beta Was this translation helpful? Give feedback.
@tlays In this package, the Firebase JS SDK is the source of truth for auth, so the cookies will set/unset depending on Firebase's auth status.
Indefinite authentication: By default, Firebase should persist authentication locally that lives beyond the session (see Firebase persistence docs). If you're signed out after closing the session, you probably have to look at your Firebase settings or ensure your browser isn't clearing local storage on close.
next-firebase-auth
also defaults to keeping auth cookies for 1 week, so it will also keep the user authenticated by default.Session authentication: If you set Firebase JS SDK to session storage, you should also make sure
next-firebase-auth
c…