Closed tomerkob closed 3 years ago
Good morning 👋 looks like you're using a two year old version (1.1.34) of aws-amplify
. Would you mind upgrading to the latest version (3.3.27) and testing if this issue still occurs?
I recently had to reproduce another issue that had to do with expired tokens and this is the error I was getting on the latest version.
Hi, currently also have issue with the latest version does not call to get the token
@frontr-uk are you experiencing the same issue? Could you post the error message or response you're getting from Cognito?
@chrisbonifacio it's hard for us at the moment to update to the recent version, since there are breaking changes. so for now, we've forked your repository only for auth packager use and changed only the throw action to throw the actual error only if the error thrown is not "No current user". and in our app de we're overriding auth package with our forked one. we are in the middle of testing it out
That's understandable. I am going to close this issue as I am unable to reproduce it and it seems the correct error is being thrown in the latest version. Please feel free to re-open if you need additional help and/or let us know how the testing goes.
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.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
currentAuthenticatedUser() throws "not authenticated" instead of the actual error. in the case of identity token is expired and the app is offline (no internet), and in the process of receiving response from currentAuthenticatedUser() amplify tries to refresh the token, and even if there is a network error, instead of throwing the actual error we get "not authenticated". which makes it impossible to differentiate when an error occurs because of unauthenticated/expired refresh token and other issue which should be handled very differently.
Expected behavior
when currentAuthenticatedUser() fails, it should throw the actual error that occurs.
Reproduction steps
1) login with user (in my example using federated sign in with a react native app) 2) disconnect from the internet 3) wait for the identity token and access token to expire 4) call currentAuthenticatedUser() 5) catch the error that the function returns..
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
iphone12
Mobile Operating System
IOS14.2
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response