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

[Authenticator] Authenticator should handle SessionExpiredException/SignedInException #145

Closed
2 tasks done
mattcreaser opened this issue Apr 26, 2024 · 2 comments
Closed
2 tasks done
Assignees
Labels
authenticator This issue relates to the Authenticator component bug Something isn't working

Comments

@mattcreaser
Copy link
Member

mattcreaser commented Apr 26, 2024

Before creating a new issue, please confirm:

Which UI component?

Authenticator

Gradle script dependencies

// Put output below this line

Environment information

# Put output below this line


Please include any relevant guides or documentation you're referencing

No response

Describe the bug

When Authenticator does a fetch auth session when launching it can get an ExpiredSessionException. If this happens it shows the Sign In screen again, but any attempts to sign in result in a SignedInException because there is already a user signed in.

This may be a bug in Amplify itself (to be verified if this expected), if not then this should be handled within Authenticator.

Reproduction steps (if applicable)

  1. In your cognito pool set your refresh token expiry to 60 minutes. This is under App Integration > client. (this is not necessary, but makes the issue much easier to reproduce)
  2. Sign in with a user
  3. Let the refresh token expire
  4. Launch the app again, sign in screen will re-appear
  5. Try to sign in again

Expected: Sign in is successful
Actual: "Something went wrong"

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

Additional information and screenshots

No response

@github-actions github-actions bot added the pending-triage Issue is pending triage label Apr 26, 2024
@vincetran vincetran added the bug Something isn't working label Apr 26, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label Apr 26, 2024
@vincetran vincetran added authenticator This issue relates to the Authenticator component pending-triage Issue is pending triage and removed pending-triage Issue is pending triage labels Apr 26, 2024
@phantumcode phantumcode self-assigned this Jul 12, 2024
@pmellaaho
Copy link

So, the fix for this problem should have been released with Authenticator v.1.2.3
I tested this but unfortunately the sign-in is still not possible, here is the logs from Authenticator:

Moving to initial step: com.amplifyframework.ui.authenticator.enums.AuthenticatorStep$SignIn@42a7884
Moving to step: com.amplifyframework.ui.authenticator.enums.AuthenticatorStep$SignIn@42a7884
Encountered AuthException: SignedInException{message=There is already a user signed in., cause=null, recoverySuggestion=Sign out the user first before signing in again.}
Sending message: com.amplifyframework.ui.authenticator.util.UnknownErrorMessage@a46ea43

I suppose, after some debugging, that the fix was made to handleSignedIn() -method but it also needs to be fixed in handleSignInFailure()?

Copy link
Contributor

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authenticator This issue relates to the Authenticator component bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants