-
Notifications
You must be signed in to change notification settings - Fork 929
Firebase Auth w/Provider: Calling getRedirectResult() is unecessary, documentation is flawed #1682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I found a few problems with this issue:
|
These are just snippets. They are not meant to be copied and pasted as is. Typically In most cases, How the above is wired varies on your requirements. |
@bojeil-google I think your answer makes sense, and I can appreciate that. But I also strongly agree with what @junkomatic is saying because the documentation example is very misleading. It implies that you need to use all of these pieces to get logged in, and if you're new to this process, it's very difficult to put the pieces together correctly. It would be helpful if the example was clearer or there was another, simpler version. |
I'm not sure where you got that screenshot, but the documentation on Firebase now shows,
This looks fair enough to me. |
For an additional context, you may also check out our quickstart guide in facebook redirect for a sample use case of |
Hey @junkomatic. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Since there haven't been any recent updates here, I am going to close this issue. @junkomatic if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
In all of the documentation/examples I can find, getRedirectResult() is called immediately after signInWithRedirect() is called. Even using
.then
, getRedirectResult returns immediately with a null user in the result, before the redirect even happens. This is not useful. Is there a way of detecting the actual redirect before calling 'getRedirectResult()'?With the inclusion of the 'onAuthStateChanged' observer, which apparently waits until getRedirectResult actually resolves with a non-null user object, it seems like the inclusion of calling getRedirectResult only causes confusion.
Is anyone actually using a call to 'getRedirectResult()' in their auth flow/implementations? There are currently several unsolved stack overflow questions about it returning null, with suggestions mainly pointing to: "forget it, and just use onAuthStateChanged".
Screenshot from official documentation telling people to do it this way:

The text was updated successfully, but these errors were encountered: