Let's say in my application; I want to offer some parts of the features only for verified users. I am confused about how to check if the current user is verified or not. I checked to Amplify docs for flutter but couldn't find a proper way for it.
2 Answers
Please see this Thread: https://github.com/aws-amplify/amplify-flutter/issues/581
It says:
iOS isSignupComplete is determined by AuthSignUpResult.nextStep. The former is always false when nextStep != done.
Android isSignupComplete is marked as true once the sign up request completed successfully.
Although isSignupComplete may be inconsistent between both platforms, checking SignUpResult.nextStep should be sufficient to determine if user has completed signing up confirmation.
E.g.
SignUpResult createAccountResult = await Amplify.Auth.signUp(
username: email.text,
password: password.text,
options: CognitoSignUpOptions(userAttributes: {'email': email.text}));
if (res.nextStep.signUpStep == 'CONFIRM_SIGN_UP_STEP') {
// continue to confirm sign up step
}
if (res.nextStep.signUpStep == 'DONE') {
// complete sign up
}
This applies to native Plattforms but should be the same by checking signUpStep in Flutter

- 907
- 7
- 20
-
Firstly thanks for your response. I don't think it's a good solution; since confirmation can be completed after sign up, how should I check after it, sending sign up request again just to check the confirmation doesn't make sense – Logaritma26 Nov 13 '21 at 21:00
-
You are totally right sir thanks for the remark. I would suggest raising an issue if the package doesnt offer any getters for that – DEFL Nov 14 '21 at 12:43
-
1If retry with same email, it just sends an error, saying email already exists. – AsifHabib Dec 18 '21 at 19:24
The Approach i tried to check whether the user is Verified or not is to try (the coding snippets are dart u can assume that for ur application basis)
Amplify.Auth.login()
and i done this try-catch block and am expecting the error called
UserNotConfirmedException
then am showing the confirmation Page Hope this helps
And also amplify is not good yet in docs. But the packages are well written u need to dig in directly the package's codebase to understand some unknown helpful things which are not in docs

- 55
- 1
- 2