Skip to content

Sentry reports AuthException(message: Invalid Refresh Token: Refresh Token Not Found, statusCode: 400) #930

Closed as not planned

Description

@RCVZ

Describe the bug
Sentry reports a couple of AuthException's
All of the reports are on iOS(But those are like 99% of my users)

To Reproduce
I have not been able to reproduce this with one of my own devices.

Version:
supabase_flutter 2.5.2
supabase 2.1.2
functions_client 2.1.0
gotrue 2.6.1
postgrest 2.1.1
realtime_client 2.0.4
storage_client 2.0.1

Additional context

AuthException(message: Invalid Refresh Token: Refresh Token Not Found, statusCode: 400)
  App                 0x10bb1abd4  GoTrueClient.notifyException (gotrue_client.dart:1206)
  App                 0x10bd5c604  GoTrueClient.recoverSession (gotrue_client.dart:995)
  File "<asynchronous suspension>"
  App                 0x10bd5c32c  SupabaseAuth.recoverSession (supabase_auth.dart:90)
  File "<asynchronous suspension>"
  App                 0x10bb1aa3c  CancelableCompleter.complete.<T> (cancelable_operation.dart:427)

Activity

  1. added
    bug
    on May 14, 2024
  2. dshukertjr commented on May 14, 2024

    @dshukertjr
    Member

    Duplicate of #928

  3. RCVZ commented on May 14, 2024

    @RCVZ
    Author

    @dshukertjr This is not a duplicate! This error states refresh token not found.

  4. added
    auth
    on May 14, 2024
  5. dshukertjr commented on May 14, 2024

    @dshukertjr
    Member

    @RCVZ Next time when you open an issue, you can give the issue a more descriptive name so that it does not look like a duplicate.

  6. changed the title [-]Sentry reports AuthException[/-] [+]Sentry reports AuthException(Invalid Refresh Token: Refresh Token Not Found)[/+] on May 14, 2024
  7. changed the title [-]Sentry reports AuthException(Invalid Refresh Token: Refresh Token Not Found)[/-] [+]Sentry reports AuthException(message: Invalid Refresh Token: Refresh Token Not Found, statusCode: 400)[/+] on May 14, 2024
  8. dshukertjr commented on May 14, 2024

    @dshukertjr
    Member

    Thanks for updating the title!

  9. Donaldd commented on May 18, 2024

    @Donaldd

    I've been getting the same issue. User is suddenly logged out of the app and then we get this error message (see below) from Sentry.
    Screenshot 2024-05-17 at 7 06 32 PM

  10. jhb-dev commented on Jul 4, 2024

    @jhb-dev

    I get the same exception when I reopen my web app where I was previously logged in after a longer period of time. I am currently catching this error from the onAuthStateChange Stream but I am not sure how to handle it. When I reload the web-app, the user is logged out and everything works fine.

    After digging into the _callRefreshToken method in the GoTrue client I found out that the user is automatically signed out on every AuthException which is not a AuthRetryableFetchException. There is also a test to ensure that the user is logged out when the refresh token is invalid.

    In my app, even though I see the **** onAuthStateChange: AuthChangeEvent.signedOut log in my console when the "Invalid Refresh Token" exception is thrown, I don't receive the AuthChangeEvent.signedOut event when listening to the onAuthStateChange, instead I receive the exception and have to handle it in some way. Currently, I sign out the user manually, which seems to work.

    @dshukertjr What is the preferred way to handle this exception?

    I found some more information about this exception here:

  11. RCVZ commented on Jul 25, 2024

    @RCVZ
    Author

    @dshukertjr When is this issue going to be fixed? 3 months have already passed!

  12. RCVZ commented on Aug 13, 2024

    @RCVZ
    Author
  13. github-actions commented on Mar 1, 2026

    @github-actions
    Contributor

    This issue has been inactive for 180 days.
    It will be automatically closed in 30 days if there is no further activity.

    If you believe this issue is still relevant, please leave a comment to keep it open.
    Thank you for your contributions!

  14. github-actions commented on Apr 5, 2026

    @github-actions
    Contributor

    This issue was automatically closed due to inactivity.

    If you believe this is still relevant, feel free to reopen it or create a new issue with updated information.

  15. added a commit that references this issue on Jun 26, 2026
    a154852
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Staleauthbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions