File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,11 @@ export async function exchangeCodeForTokens(
145145 } ) . toString ( ) ,
146146 } ) ;
147147
148- if ( ! response . ok ) return null ;
148+ if ( ! response . ok ) {
149+ const err = await response . text ( ) . catch ( ( ) => "" ) ;
150+ console . error ( `[auth] exchangeCodeForTokens failed: ${ response . status } ${ err } ` ) ;
151+ return null ;
152+ }
149153 return response . json ( ) ;
150154}
151155
@@ -165,7 +169,11 @@ export async function refreshAccessToken(refreshToken: string): Promise<{
165169 } ) . toString ( ) ,
166170 } ) ;
167171
168- if ( ! response . ok ) return null ;
172+ if ( ! response . ok ) {
173+ const err = await response . text ( ) . catch ( ( ) => "" ) ;
174+ console . error ( `[auth] Token exchange failed: ${ response . status } ${ err } ` ) ;
175+ return null ;
176+ }
169177 return response . json ( ) ;
170178}
171179
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const getLogoutConfigFn = createServerFn({ method: "GET" }).handler(
88 const dashboardUrl = process . env . DASHBOARD_URL || "http://localhost:4000" ;
99 const clientId = process . env . DASHBOARD_CLIENT_ID || "dashboard" ;
1010 return {
11- endSessionUrl : `${ LANYARD_URL } /api/auth/oauth2/endsession ?client_id=${ encodeURIComponent ( clientId ) } &post_logout_redirect_uri=${ encodeURIComponent ( `${ dashboardUrl } /login` ) } ` ,
11+ endSessionUrl : `${ LANYARD_URL } /api/auth/oauth2/end-session ?client_id=${ encodeURIComponent ( clientId ) } &post_logout_redirect_uri=${ encodeURIComponent ( `${ dashboardUrl } /login` ) } ` ,
1212 } ;
1313 } ,
1414) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ export const Route = createFileRoute("/api/auth/callback")({
2424 ) ;
2525 }
2626
27+ console . log ( "[auth/callback] Exchanging code for tokens..." ) ;
2728 const tokens = await exchangeCodeForTokens ( code , codeVerifier ) ;
29+ console . log ( "[auth/callback] Tokens result:" , tokens ? "success" : "null" ) ;
2830 if ( ! tokens ) {
2931 return new Response (
3032 JSON . stringify ( {
@@ -67,7 +69,8 @@ export const Route = createFileRoute("/api/auth/callback")({
6769 "Set-Cookie" : cookie ,
6870 } ,
6971 } ) ;
70- } catch {
72+ } catch ( err ) {
73+ console . error ( "[auth/callback] Error:" , err ) ;
7174 return new Response (
7275 JSON . stringify ( { error : "Internal server error" } ) ,
7376 {
You can’t perform that action at this time.
0 commit comments