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.

Auth.verifyCurrentUserAttribute - Error: No current user

See original GitHub issue

Describe the bug The process to verifying the attribute like ‘email’, via Auth.verifyCurrentUserAttribute(attr), is not finding the user and sending the ‘the_verification_code’ to email.

I already have successfully implemented every other Authentication feature needed in the app.

Code To Reproduce Redux Action that connects w/ AWS:

export function checkAttribute(email) {
  return dispatch => {
    dispatch(confirmUserLoading(true));
    console.log('UserEmail:', email);
    Auth.verifyCurrentUserAttribute(email)
      .then(() => {
        dispatch(confirmUserCodeSentSucessfully());
        console.log('verification code - UserEmail:', email);
        console.log('a verification code is sent');
      })
      .catch(err => {
        dispatch(confirmUserError());
        dispatch(confirmUserErrorMsg(err));
        console.log('error - UserEmail:', email);
        console.log('confirmUser with error', err);
      });
    dispatch(confirmUserLoading(false));
  };
}

Expected behavior find user and send the_verification_code to email to continue process

Screenshots auth verifycurrentuserattribute-issue

dependencies :

"dependencies": {
        "aws-amplify": "^1.1.5",
        "aws-amplify-react-native": "^2.0.5",
        "native-base": "^2.7.2",
        "react": "16.4.1",
        "react-native": "0.56.0",
        "react-native-prompt": "^1.0.0",
        "react-native-vector-icons": "^5.0.0",
        "react-navigation": "^2.11.2",
        "react-redux": "^5.0.7",
        "redux": "^4.0.0",
        "redux-thunk": "^2.3.0"
    },

Smartphone :

  • Device: iPhone6

Let me know if you need further info. Thanks for looking into it

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ngocketitcommented, Mar 17, 2019

@powerful23 How could that Auth.resendSignUp help if the username is auto generated? Currently, I’m generating username automatically and use email/phone number as alias to sign in. If user signs up with email and not enter the confirmation code right after the click the “Sign Up” button, and later tries to log in with email, he will get User does not exist. I’m thinking of a way to get the auto generated username from email (such as a Lambda) and use that instead of email for logging in. In that case, I’ll get UserNotConfirmedException and I can show the confirmation screen for user to enter the code again. Is there any other better workaround? Thanks!

0reactions
github-actions[bot]commented, Jun 13, 2021

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

No current user for authenticated user in Amplify
The error is literally saying No current user - you need to sign in using the supported identity ...
Read more >
Authentication - Password & user management - JavaScript
It will throw an error if there is no user logged in. This method should be called after the Auth module is configured...
Read more >
AuthClass | amplify-js
Defined in packages/auth/src/Auth.ts:817. This was previously used by an authenticated user to get MFAOptions, but no longer returns a meaningful response.
Read more >
VerifyUserAttribute - Amazon Cognito User Pools
The verification code in the request to verify user attributes. Type: String ... This exception is thrown when Amazon Cognito encounters an internal...
Read more >
Allow Users to Change Their Email - SST.Dev
This gets the current user and updates their email using the Auth module from Amplify. Next we render the form where they can...
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