onAuthStateChanged not working ( new firebase )

2,610 views
Skip to first unread message

Evans Attafuah

unread,
May 21, 2016, 5:39:43 AM5/21/16
to Firebase Google Group
Hello,

Am have just updated to the latest firebase implementation but my onAuthStateChanged event does not fire anymore. I am signing in with custom token. Is anyone experiencing the same problem? 

Also I can't seem to find the page for setting expiration date on when the tokens expire. 

Regards,
Evans. 

Frank van Puffelen

unread,
May 21, 2016, 12:11:49 PM5/21/16
to Firebase Google Group
Hey Evans,

With the latest updates to FIrebase Authentication, the user's sign-in session doesn't expire anymore. We instead have infinite credentials and a short-lived token that automatically refreshes (every hour). This gives your user the best experience, because they won't have to sign-in repeatedly, while keeping your app secure, by having a short-lived access token.

 Most of our samples depend on onAuthStateChanged and they've been working without problems. Can you post the minimal code that would allow us to reproduce that problem? Keep in mind that this might be a better fit for Stack Overflow, which we recommend using for code-related questions.

    puf

Matthew Turney

unread,
May 31, 2016, 2:18:48 PM5/31/16
to Firebase Google Group
This seems incorrect. Everytime I refresh the page of my firebase app it logs my users out. So the session does not automatically persist using the new v3 SDK. How do I prevent the session from logging out every time the users navigate away from the app?

boj...@google.com

unread,
May 31, 2016, 6:24:08 PM5/31/16
to Firebase Google Group
Hey Evans and Matthew,
Can you guys provide more information (platform, environment) or code snippets? Are you guys using the web SDK?

Matthew Turney

unread,
May 31, 2016, 10:05:21 PM5/31/16
to fireba...@googlegroups.com
Turns out it was my mistake. I change where my hook for the auth state was and it was never executed. The default view just happened to be my login page. Thanks for the quick reply on this!
> --
> You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/fJKDlKVg7p4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
> To post to this group, send email to fireba...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/9ad3db0c-3f63-47b4-a040-a2bcbf314411%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

signature.asc
Reply all
Reply to author
Forward
0 new messages