swyxio / swyxdotio

This is the repo for swyx's blog - Blog content is created in github issues, then posted on swyx.io as blog pages! Comment/watch to follow along my blog within GitHub
https://swyx.io
MIT License
325 stars 43 forks source link

What to do with Supabase auth `OAuth state is invalid: signature is invalid` #497

Closed swyxio closed 6 months ago

swyxio commented 6 months ago

slug: supabase-auth-problems category: note

I am still working on my same supasbase project from yesterday. This is what happens when I run my nextjs app with supabase locally and try to log in:

image

OAuth state is invalid: signature is invalid

image

The URL is : https://REDACTED.supabase.co/auth/v1/callback?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=REDACTED

Googling these errors is of course not helpful. However the error URI mentions URI registration: https://docs.github.com/en/apps/oauth-apps/maintaining-oauth-apps/troubleshooting-authorization-request-errors#redirect-uri-mismatch

I suspect this is the callback mentioned here:

image

I have to switch from:

swyxio commented 6 months ago

i ended up solving it by switching the callback URL to the staging url... its been too long i cant remember what i did sorry. will double back if i run into this problem again.