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

User is logged out when app launched on offline #103

Closed
sasaar opened this issue Dec 13, 2024 · 5 comments
Closed

User is logged out when app launched on offline #103

sasaar opened this issue Dec 13, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@sasaar
Copy link

sasaar commented Dec 13, 2024

Describe the bug

If user launches the app in offline mode and access token is expired, user is logged out (even if refresh token is still valid). It obvious that access token cannot be refreshed as phone is offline, but could there be some other way to handle. As refresh token is still valid, access token could be refreshed when phone appears again online.

This is problematic when access token validity period is short.

Steps To Reproduce

  1. Log into the app
  2. Set phone offline and close (kill) the app
  3. Wait until access token validity time expires (e.g. 1h)
  4. Launch app again

Actual behaviour:
User sees login screen. User can continue using the app after wifi/data enabled and user has logged again into the app.

Expected behaviour:
User lands to the app as logged in. No network request can be done as access token not valid and phone in offline. As refresh token is still valid, after user enables wifi/data (phone online again), access token is refreshed and user can continue using the app normally (no need to login).

@sasaar sasaar changed the title User ism logged out when app launched on offline User is logged out when app launched on offline Dec 13, 2024
@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Dec 13, 2024
@thisisabhash thisisabhash added the bug Something isn't working label Dec 13, 2024
@thisisabhash
Copy link
Member

Hello,

Would you be able to post the verbose logs by enabling it while you're trying to reproduce the issue?

Amplify.Logging.logLevel = .verbose

Also, could you post your amplifyconfiguration.json file with sensitive information removed so that we can replicate the scenario locally.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Dec 13, 2024
@thisisabhash thisisabhash removed the pending-triage Issue is pending triage label Dec 13, 2024
@sebaland
Copy link
Member

Hi @sasaar, I was able to reproduce the issue and I'm working on a fix.

@sasaar
Copy link
Author

sasaar commented Dec 16, 2024

Thanks for your prompt answer. Do you still need logs from our side or can you proceed with your own logs/debugging?

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Dec 16, 2024
@sebaland
Copy link
Member

@sasaar the fix has been released in 1.2.3.

If after upgrading you're still facing problems, please either re-open this issue or create a new one and provide the logs.

Thanks!

Copy link

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.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@sebaland sebaland removed the pending-maintainer-response Issue is pending response from an Amplify team member label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants