Skip to content
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

Sharing state across multiple Authenticator instances #43

Closed
adamjv90 opened this issue Dec 6, 2017 · 2 comments
Closed

Sharing state across multiple Authenticator instances #43

adamjv90 opened this issue Dec 6, 2017 · 2 comments
Labels
investigating This issue is being investigated question General question

Comments

@adamjv90
Copy link

adamjv90 commented Dec 6, 2017

Attempting to share authentication state in a react native app between multiple Authenticator components that wrap only a selected few of my react-navigation tabs. Currently, I store both authState and authData in my redux store. Everything works fine until I attempt to log out. If I try simply nullifying authState and authData in my redux store the Authenticator component re logs my user back in when it is shown. If i try to first call Auth.logout I receive the warning [WARN] Hub - error dispatching auth event to noname and my user is re-logged in when the Authenticator component is shown.

@mlabieniec mlabieniec added question General question investigating This issue is being investigated labels Dec 7, 2017
@richardzcode
Copy link
Contributor

The recommended way is to call Auth.currentAuthenticatedUser to get auth state. issue 31 had some discussion about this.

Auth.currentAuthenticatedUser()
    .then(user => console.log(user))
    .catch(err => console.log(err));

For the Hub error could you share the aws-amplify-react-native version you are using?

Thanks,
Richard

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
investigating This issue is being investigated question General question
Projects
None yet
Development

No branches or pull requests

3 participants