Comments (13)
If Amplify is used only on the client side, then you wouldn't need the SSR flag.
Strange, we kept the same key format between v5 and v6, so the refresh token should be there. Probably asking the end user to delete their keys and authenticate again might help.
from amplify-js.
I think the library might not being able to pull in the tokens from the current storage mechanism. Hence the error showed. Can you run your application and do the following,
- authenticate.
- call
fetchAuthSession
with theforceRefresh
flag enabled. - check if the error was thrown
- check where the tokens are stored
In addition to that, we added additional support for Next-JS as well and the configuration requires to pass the SSR flag.
Amplify.configure(config, {
ssr: true // required when using Amplify with Next.js
});
from amplify-js.
Thank you for your response. I will let you know in the incoming weeks if happening regularly !
from amplify-js.
hello @clement-faure . Can you please expand how you are able to reproduce this issue ? Plase share,
- amplify configuration
- code snippets
- dev environment
from amplify-js.
the OAuthTokenRefreshException
is usually thrown when storage doesn't have a refresh_token
. Can you make sure tokens are stored in the cookies ?
from amplify-js.
Thank you for your quick response !
Amplify configuration :
Amplify storage mode (default localeStorage) :
When use click on remember checkbox true, storage in persisted in local storage, otherwise stored in cookies for session
from amplify-js.
I was not able to reproduce it on my own, i have a production environment with +1000 customer, and i got this error in my Sentry. This error happened after migrating to aws amplify v6
from amplify-js.
I'm gonna try that right away. I'm not using SSR on my application, do i have to enabled SSR flag necessarily ?
Amplify is only used on client side environment.
from amplify-js.
I confirm that all is working fine when reproducing your steps. Tokens are stored in local storage when "remember me" checkbox is checked, otherwise in cookies (like i've implement in my updateCognitoTokenSavingMechanism)
I think the error is linked to aws-amplify upgrade, my customer probably logged in on aws amplify v5, and when reloading app and refreshing token on aws amplify v6, the error has been thrown ? But it's not happening to all my customers.. very strange.
from amplify-js.
@clement-faure, I'll put the pending-response
label on this issue for now until we hear back from you on implementing @israx's guidance above.
from amplify-js.
@clement-faure, wanted to check in and see if you're still experiencing this. Let us know if you are!
from amplify-js.
put the
pending-response
label on this issue for now until we hear back from you on implementing @israx's guidance above.
The issue didn't happened again so i think we can close this issue safely !
from amplify-js.
@clement-faure, appreciate the quick reply! I'll close this issue then for now, but feel free to leave further comments or context if this persists.
from amplify-js.
Related Issues (20)
- amplify/auth resetPassword succeeds but customSmsSender trigger lambda never called HOT 3
- Federated Sign-in - App Sync list query Auth Error HOT 2
- Amplify not works well if I have configuring multiple user pools with condition
- Next, js, Amplify js.fetchAuthSession({forceRefresh: true}) does not work as expected and returns tokens as undefined. How to manage a refresh token in Amplify v6 in Next.js HOT 12
- Amplify CLI Gen 2 - Multiple SortKeys combined into one input with GraphQL Generation HOT 5
- AWS storage upload issue HOT 3
- Datastore.save() sending _version of previous query model instead of current model. HOT 2
- runWithAmplifyServerContext throwing error, ⨯ Error: Cannot access Cognito.length on the server. You cannot dot into a client module from a server component. You can only pass the imported name through. HOT 4
- 6.3.3 is stable ? HOT 1
- ResizeObserver loop when navigating in the Authenticator component HOT 1
- [v6] resetPassword not trigger UserMigration lambda HOT 2
- Add timeout on GET and POST api calls HOT 4
- No federated JWT token when using AppSync OIDC in Amplify Gen2 HOT 5
- Permission denied - allow.authenticated() HOT 6
- [v6] sendUserAttributeVerificationCode not send code to destination email HOT 5
- MD5 not calculating correctly when selecting file from broswer, failing with BadDigest Error HOT 5
- Auth.SignIn not allowing username only signin HOT 2
- `Hub.listen` not firing when inside `useEffect` HOT 14
- Hub should automatically fire `tokenRefresh` event through Hub HOT 1
- Google login in react native requires two login attempts to work only on production ANDROID HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-js.