question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error getting user: { message: 'Invalid Refresh Token', status: 400 }

See original GitHub issue

Bug report

Describe the bug

I’m building an app with Supabase and Next.js

From time to time I’m seeing the following error in my logs:

Error getting user: { message: 'Invalid Refresh Token', status: 400 }

I’m relatively new to supabase, I don’t really understand what that means, and I’d love some help with resolving this issue.

To Reproduce

I set up the authentication by following the @supabase/auth-helpers-nextjs tutorial. I didn’t do anything weird or unusual, just followed the instructions.

According to this, it happens with all the Supabase and Next.js examples.

Expected behavior

Not getting this error.

System information

  • OS: macOS
  • Version of supabase-js: 1.35.4
  • Version of Node.js: 16.14.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
J0commented, Jul 22, 2022

Hey @ARMATAV and @satyapalsharma going to close this issue in favour of tracking this on the gotrue-js issue.

Feel free to re-open if there are still queries or you feel that there’s merit in having this remain open though. Thanks Joel

1reaction
ARMATAVcommented, Jul 18, 2022

@ARMATAV You can change the expiration time in gotrue config

Right you are - for future people, you can access the different variables in the container’s config itself like this https://supabase.com/docs/gotrue/server/about by passing around envars.

However, still going to bug out after n seconds at this point in time - but it looks like they’re going to take a shot at fixing it - very important, very fundamental functionality.

https://github.com/supabase/gotrue-js/issues/323

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 400 when refreshing short lived tokens - Google Groups
For a very small subset of users we're getting a 400 response from the API request to refresh a token. We've prompted the...
Read more >
Invalid Refresh Token - API Q&A - Keap Community
I am getting the error Invalid Refresh Token I have not used it ... error":{"name":"Error","message":"Request failed with status code 400" ...
Read more >
Help with 400 error on /token without an error message
I think this error started occuring once we enabled “Refresh token” as a grant type in the application settings for our React SPA....
Read more >
Invalid or expired Token returns Status Code 400 (Bad Request)
This error means that the refresh token is not valid or has already been used. Do you have any concurrent requests for refresh...
Read more >
Why Does Refreshing the Access Token return 400 Invalid ...
This is exactly what their documentation suggests. But it returns 400 error: invalid request. Any ideas why? Since I just want to authenticate ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found