DEV Community

Discussion on: Guest Login in JavaScript 🤯

Collapse
pbatey profile image
Phil Batey

I don’t understand the use case for anonymous login.

Will the user credentials persist across sessions?

What happens if they close their browser?

Collapse
premierdan profile image
premierdan

Honestly, this needs further clarification.

Collapse
premierdan profile image
premierdan

🙏

Collapse
rajeshj3 profile image
Rajesh Joshi Author

Will the user credentials persist across sessions?

Yes, the session will persist untill you remove the user data from indexedDB or the session expires.

What happens if they close their browser?

The session will persist even after you restart your system itself.

Collapse
rajeshj3 profile image
Rajesh Joshi Author

Your thought is obvious, in normal situations Anonymous authentication is rare and there is no such requirements as well.

But, if you look into some specific kind of softwares like, Mobile Games (PUBG for example). It is really handy to have Anonymous authentication (also known as Guest Login) both for game testers or end users in general.

In those kinds of applications, the functionality to adding Google, Facebook, Twitter, etc. accounts in the future is possible, to persist the user data, which is also possible in Firebase as well.

I hope this answers your question buddy.

Thanks 😊

Some comments have been hidden by the post's author - find out more