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.

Authenticator componentDidMount() doesn't call this.checkUser()

See original GitHub issue

Describe the bug Authenticator componentDidMount method doesn,t call this.checkUser() in case if local storage contains Constants.SIGN_IN_WITH_HOSTEDUI_KEY because localStorage.getItem method returns string “false”

To Reproduce Steps to reproduce the behavior:

  1. login
  2. refresh page
  3. see nothing

Screenshots Image of Yaktocat

Desktop (please complete the following information):

  • OS: ubuntu
  • Browser chrome
  • Version 74.0.3729.108

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sadratabancommented, Nov 2, 2020

Hi - I’m still experiencing the same symptoms with the same steps to reproduce. It seems like after the first initial login, the ‘amplify-signin-with-hostedUI’ key in localstorage still exists/set to ‘true’, and on the refresh after login, the amplify-signin-with-hostedUI key still exists, and this.checkUser isn’t called.

If I remove this key manually after authState===‘signedIn’, then the refresh works as expected. My understanding is after the cognito redirect has happened, the amplify-signin-with-hostedUI key should have been removed right after so that future refreshes work normally. This doesn’t seem to be happening.

I’m using Auth.federatedSignIn({provider: ‘Google’}) to sign users in, if that makes any difference

I tried to do exactly what you did. But the issue still exists. Could you please share your code snippet?

0reactions
github-actions[bot]commented, Feb 10, 2022

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why componentDidMount() is the better place to evaluate ...
Renderize a loading animation component if this.state.firsTime is true; After that, componentDidMount() will be called, and here will be called ...
Read more >
React Lifecycle Methods Render And ComponentDidMount
When the component file is called it calls the render() method by default because that component needs to display the HTML markup or...
Read more >
Handling user authentication with Firebase in your React ...
Learn how to add user authentication to your React apps using Firebase, allowing for both Google authentication and email/password sign-in.
Read more >
disable browser back button react
Please look into componentDidMount () and componenetDidUnmount () methods. ... check user's authentication on your application's pages (i.
Read more >
how to delete router history - cseliphotoagency.us
Try to use goBack (), go (n) for programmatically and for browser back button use ... I wanted to say that you should...
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