You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main issue is that the current example is structured in a way were it assumes the only thing you will ever do in your middleware is authenticate with supabase, but often I would think that is not the case.
My current project has some complex redirection logic, so I can't just simply return the supabaseResponse. The docs suggest making a new NextResponse and manually setting the cookies
The only problem is the cookies property on NextResponse is of type ResponseCookies which does not actually have a setAll method.
Describe the improvement
It would be fantastic if there was:
A recommended way to pass on the Supabase cookies to new responses
An example where the middleware does more than simply return await updateSession
Maybe an example repo to go off of and could be linted as to avoid recommending non existent or depreciated apis
I'm upgrading my auth from 0.6 @supabase/auth-helpers-nextjs and I was actually in the process of writing a separate issue earlier asking for the docs to no longer recommend get, set and delete, but #27242 literally merged as I was writing it (thanks @hf), but I've run into this separate issue now. If any other additional information is needed just let me know- happy to help.
Thanks so much
The text was updated successfully, but these errors were encountered:
Improve documentation
Link
https://supabase.com/docs/guides/auth/server-side/nextjs?queryGroups=router&router=app
Describe the problem
The main issue is that the current example is structured in a way were it assumes the only thing you will ever do in your middleware is authenticate with supabase, but often I would think that is not the case.
My current project has some complex redirection logic, so I can't just simply return the
supabaseResponse
. The docs suggest making a newNextResponse
and manually setting the cookiesThe only problem is the
cookies
property onNextResponse
is of typeResponseCookies
which does not actually have asetAll
method.Describe the improvement
It would be fantastic if there was:
return await updateSession
I'm upgrading my auth from 0.6
@supabase/auth-helpers-nextjs
and I was actually in the process of writing a separate issue earlier asking for the docs to no longer recommendget
,set
anddelete
, but #27242 literally merged as I was writing it (thanks @hf), but I've run into this separate issue now. If any other additional information is needed just let me know- happy to help.Thanks so much
The text was updated successfully, but these errors were encountered: