Closed pablovargasosorio closed 10 months ago
hello @pablovargasosorio . Sorry for the inconvenience. Can you trying calling fetchAuthSession
as follows fetchAuthSession({forceRefresh:true})
? This option will bypass cache and refresh the current session.
@pablovargasosorio, let us know if making that change to the API you're calling resolves your issue. There's documentation around this API that can be found here, but if you feel there's improvements we can make then we'd love to hear it!
@israx @cwomack It seems that works for me, thank you very much! The API doc is really poor, migrating from v5 has been a real pain. I had to dig into the inner library logic... Fortunately, that was my last migration blocker. Thanks! ;)
@pablovargasosorio, glad to hear you were able to get this resolved! Also appreciate the feedback about the migration from v5 and improvements we can make on the docs. If there's something that was particularly unclear, we'd love to have you create an issue on our amplify-docs repo (here) so that we can make the upgrade process more clear and smooth!
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
We used to manually refresh the session token when expired. Using the V5 cognitoUser.refreshSession function and cognitoUser.signInUserSession.refreshToken
It seems there's no alternative in V6, and no documentation for this breaking change.
Expected behavior
Be able to refresh the session in V6
Reproduction steps
Code Snippet
This is the V5 unauthorized 401 interceptor code snippet:
I tried with the equivalent V6 getCurrentUser, but the response is not a 'cognitoUser' object. Also, I coudn't find any equivalent API method for refreshSession.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response