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

Bug or misuse of Auth.currentAuthenticatedUser()? #3439

Closed
GutteApps opened this issue Jun 12, 2019 · 3 comments
Closed

Bug or misuse of Auth.currentAuthenticatedUser()? #3439

GutteApps opened this issue Jun 12, 2019 · 3 comments
Labels
Auth Related to Auth components/category React Native React Native related issue

Comments

@GutteApps
Copy link

Environment:
react-native 0.57.8
@aws-amplify/core: 1.0.22
@aws-amplify/auth: 1.2.15

Description:
Our signup flow consists of the following steps:

  1. await Auth.signUp({
    username: email,
    password: create_UUID(),
    attributes: { 'custom:devicePK': JSON.stringify([devicePublicKey]) }
    });
  2. await Auth.signIn(email)
  3. await Auth.sendCustomChallengeAnswer(tempUser, authenticationCode)

once a user passes this flow we create some unique data for him that we persists locally.

when the user launches the app we check for the existence of the data and call Auth.currentAuthenticatedUser().
if data exists & user exists we consider the user verified and let him in.

using analytics, we noticed that in about 6% of cases, Auth.currentAuthenticatedUser() will throw an error for previously signed in users causing them them to be sent to on-boarding flow.

when these users relaunch the app, Auth.currentAuthenticatedUser() returns a user and they are signed in.

can you explain this behaviour? is this a bug or we're misusing Auth.currentAuthenticatedUser()?

@haverchuck haverchuck added React Native React Native related issue Auth Related to Auth components/category labels Jun 12, 2019
@haverchuck
Copy link
Contributor

@GutteApps What is error that is being surfaced? Additionally, do you think it's possible that this behavior is related to a known AsyncStorage issue?

@stale
Copy link

stale bot commented Jun 21, 2019

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@stale stale bot closed this as completed Jun 21, 2019
@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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Auth Related to Auth components/category React Native React Native related issue
Projects
None yet
Development

No branches or pull requests

2 participants