File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
course-matrix/backend/src/middleware Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,15 @@ export const authHandler = asyncHandler(
3030
3131 try {
3232 // Verify the session
33- const { data, error } = await supabase . auth . refreshSession ( {
34- refresh_token : refreshToken ,
35- } ) ;
33+ const { data, error } = await supabase . auth . getUser ( )
3634
3735 if ( error ) {
3836 res . clearCookie ( "refresh_token" ) ;
3937 return res . status ( 401 ) . json ( { message : "Invalid or expired session" } ) ;
4038 }
4139
42- // Attach user and session to request for route handlers to access later
40+ // Attach user to request for route handlers to access later
4341 ( req as AuthenticatedRequest ) . user = data ?. user ?? undefined ;
44- ( req as AuthenticatedRequest ) . session = data ?. session ?? undefined ;
4542
4643 next ( ) ;
4744 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments