Git Product home page Git Product logo

Comments (13)

israx avatar israx commented on June 15, 2024 2

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.

israx avatar israx commented on June 15, 2024 1

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,

  1. authenticate.
  2. call fetchAuthSession with the forceRefresh flag enabled.
  3. check if the error was thrown
  4. 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.

clement-faure avatar clement-faure commented on June 15, 2024 1

Thank you for your response. I will let you know in the incoming weeks if happening regularly !

from amplify-js.

israx avatar israx commented on June 15, 2024

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.

israx avatar israx commented on June 15, 2024

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.

clement-faure avatar clement-faure commented on June 15, 2024

Thank you for your quick response !

Amplify configuration :

Capture d’écran 2024-03-25 à 14 09 45

Amplify storage mode (default localeStorage) :

Capture d’écran 2024-03-25 à 14 10 26

When use click on remember checkbox true, storage in persisted in local storage, otherwise stored in cookies for session

from amplify-js.

clement-faure avatar clement-faure commented on June 15, 2024

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.

clement-faure avatar clement-faure commented on June 15, 2024

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.

clement-faure avatar clement-faure commented on June 15, 2024

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.

cwomack avatar cwomack commented on June 15, 2024

@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.

cwomack avatar cwomack commented on June 15, 2024

@clement-faure, wanted to check in and see if you're still experiencing this. Let us know if you are!

from amplify-js.

clement-faure avatar clement-faure commented on June 15, 2024

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.

cwomack avatar cwomack commented on June 15, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.