-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auth.getUser returns an error: Auth Session Missing v2.43.2 #948
Comments
@NickG-NZ I also ran in to this yesterday intermittently Any resolution? |
No resolution for us yet. We're sitting on an old version until the supabase team responds |
For what it's worth, I had the same error. I manually inspected the cookies and found my cookies were not chunked correctly as The cookie chunking algorithm, when provided with |
@NickG-NZ which version of next.js are you on? seem to be running into the same issue with supabase-js 2.43.2 and any version of next.js above 14.0.4 |
can confirm this is also happening for me on supabase-js 2.43.4 and nextjs 14.0.4 |
Same here I can't use .getUser() in serverless functions, or in API Routes. |
@RickWoltheus I'm running into the same problem. I installed the latest version, but when I downgrade it doesn't work anymore. I'm a relatively new dev, so how do I downgrade to a version that works? |
these are my dependencies when I run npm list. You haven't included your supabase-js version in the screenshot. The package that this Github issue is about ( To switch to this particular version you would just run |
We're on 14.1.4. Are you saying that running an older version of NextJS fixes it? |
@Donald646 This is really unrelated to the current issue. Can you please try Google, GPT or StackOverflow. |
Going back to an older version of @supabase/supabase-js doesn't work for me. My local development is down, as users on the serverside is a core part of it. This issue has also been open for a while now, so I don't know when it's gonna be fixed. |
Having the same issue on supabase-js 2.43.4. |
Hey Guys, Having the same issue on:
Has anyone figured out which version introduces the breaking change? |
@kangmingtay Seems there are a lot of people affected by this. Just want to make sure the supabase team is aware of it. |
This is insane, |
I've reached out to their support team directly, and they told me they have escalated this issue to the auth team. But no other fixes so far. |
This is freaking insane! |
Similar here. If a route fetches using POST with body to another route, auth/cookies are lost. Works if I change it to redirect with GET and query params
|
The strangest bit for me is that everything works fine locally. My flow is the following:
|
hey everyone, we're investigating this issue - we made
you should also be able to see any errors with the auth service in your project's auth logs (https://supabase.com/dashboard/project/_/logs/auth-logs) - specifically, you should be watching out for errors against the "/user" endpoint over the time period where @zeropaper i don't think you can pass the const userClient = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
auth: {
autoRefreshToken: false,
persistSession: false,
detectSessionInUrl: false
}
});
const { data } = await userClient.auth.getUser(); |
Changed POST to GET and cookies are now getting passed correctly. Edit: It keeps on braking. The cookie are passed only sometimes. |
It might be related to caching. I removed the staleTime of my React Query config and the cookie now persist and it's passed to the route handler with both GET and POST. |
Ran into this issue, downgrading to
didn't seem to fix it with This is following the documentation and attempting to access current user in a Was migrating a from Firebase but I guess we'll wait until this is figured out. |
I get an error when I call auth.getUser as follows using the browser client in Nextjs.
but when I did the same thing using the server client, no error occurred and it was handled correctly. I implemented the browser client and server client according to the following link: https://supabase.com/docs/guides/auth/server-side/nextjs I hope this helps. |
I'm getting the exact same error, is there a way to solve this another way? |
I am experiencing these issues as well. |
It seems this person is getting around the issues: https://github.com/ElectricCodeGuy/SupabaseAuthWithSSR/tree/main |
This approach worked great - |
Hey everyone. Getting no user if the cookies are present means that you probably have an incorrect Please follow the SSR guides to the dot. https://supabase.com/docs/guides/auth/server-side/creating-a-client?environment=server-component&queryGroups=framework&framework=nextjs |
Just started getting this error on the latest |
Hi everyone, I have the same issue. It happened after a reset of the database, but I don't know if it is linked. Someone find a solution ? '@supabase/ssr':
specifier: ^0.3.0
version: 0.3.0(@supabase/[email protected]) |
You are definitely right about the middleware causing this issue (at least in my case). My middleware was just fine until I implemented protectedRoutes. It seems that the two asynchronous calls (one to updateSession from supabase/middleware, the other from my isAuthenticated custom function) caused this issue. Thank you for pointing that out, you're my saviour! |
Facing this error still Steps followed - Same issue even with Azure Although login happens, cannot get the session/user |
I'm getting same issue |
I had the same issue, after many hours of debugging I found I should be using the following client when signing in on the client Instead of Wasn't so clear in the docs! |
Bug report
Describe the bug
After upgrading from v2.38.4 to v2.43.2, calling auth.getUser in a NextJS route handler returns an
AuthSessionMissing
error for a logged in user (session cookie exists and is passed to the client).It seems to be the same bug from issue supabase/supabase-js#1025 that was discovered and already fixed for edge functions. In this case it is happening when using the Supabase SSR library.
To Reproduce
Steps to reproduce the behaviour, please provide code snippets or a repository:
Run
await supabaseAuthClient.auth.getUser()
in a NextJS route-handler (or presumably any serverless runtime using a supabase SSR client)Expected behavior
The user is returned.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: