Auth state is an invalid state after multi-step custom challenge failed (InvalidStateException) #2754
Labels
auth
Related to the Auth category/plugins
bug
Something isn't working
closing soon
This issue will be closed in 7 days unless further comments are made.
Before opening, please confirm:
Language and Async Model
Kotlin - Coroutines
Amplify Categories
Authentication
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
Our app uses a multistep custom challenge, so after signin there's captcha and sms code.
The app gets correct response after captcha:
Auth State Change: Configured(authNState=SigningIn(signInState=ResolvingChallenge(challengeState=WaitingForAnswer(challenge=AuthChallenge(challengeName=CUSTOM_CHALLENGE, username=..., session=..., parameters={challengeType=SMS, phone=...}), hasNewResponse=true))), authZState=SigningIn(id=))
Correct sms challenge works correctly, wrong challenge gets not authorized response, but anything after that returns an
InvalidStateException
Calling
resendSignUpCode
,signOut
or anotherconfirmSignIn
all return InvalidStateException.Auth State Change: Configured(authNState=SigningIn(signInState=ResolvingChallenge(challengeState=Error(exception=NotAuthorizedException(message=Invalid session for the user.), challenge=AuthChallenge(challengeName=CUSTOM_CHALLENGE, username=..., session=..., parameters={challengeType=SMS, phone=...}), hasNewResponse=true))), authZState=SigningIn(id=))
There doesn't seem to be any way to reset auth state or reinitialize the auth plugin other than killing the app.
What is the solution for this state ?
Reproduction steps (if applicable)
InvalidStateException
Code Snippet
// Put your code below this line.
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: