question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

isPendingRedirect() and browser 'back' navigation

See original GitHub issue

I’m using the result of isPendingRedirect() to update the page in which the widget is contained (this is a Vue-based SPA), and also to show / hide a ‘log in anonymously’ button. But if the user clicks on, say, ‘Sign in with Email’, they are taken to the account chooser page (away from my app). If they then realise they clicked on the wrong button and hit the browser ‘back’ button, my app is loaded again, but isPendingRedirect() returns true, so my page now doesn’t have a log in anonymously button, and also the label now says ‘Please wait’ instead of ‘Please log in’, as it’s expecting the login to be in progress.

How can I tell the difference between my page loading because there really is a pending login, and simply due to navigation?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
7-of-9commented, Jan 3, 2019

@fterradev Agreed - is there no way at all to determine if the user canceled the login flow by hitting the back button??

0reactions
bojeil-googlecommented, Jul 27, 2020

isPendingRedirect() is to determine whether the UI needs to be rendered to complete a signInWithRedirect, linkWithRedirect or accountchooser.com redirect operations. If the user hits a Sign in with email button accidentally and then the user clicks the browser back button, showing the UI again is still reasonable as it should render the sign-in UI (which is the screen where the user was before the redirect).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Has firebaseUI no 'keep me signed in' option? - Stack Overflow
I have figured out how to implement firebaseUI with user controlled persistence ('keep me signed in' option). The solution involves (1) ...
Read more >
Easily add sign-in to your Web app with FirebaseUI - Google
isPendingRedirect() to detect if the URL corresponds to a sign-in with ... An optional emailLinkSignIn callback can be defined to return the firebase.auth....
Read more >
Convert UiApp to HtmlService, HtmlService Google Script, Google ...
HtmlService: Service for returning HTML and other text content from a script. ... isPendingRedirect() to detect if the URL corresponds to a sign-in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found