File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,10 +117,10 @@ export async function authRoutes(app: FastifyInstance) {
117117 { expiresIn : '30d' }
118118 ) ;
119119
120- // For mobile app: redirect with token as query param
120+ // For mobile app: redirect with token as URL fragment (not sent to servers, keeps token out of logs)
121121 const mobileRedirect = process . env . MOBILE_REDIRECT_URI ;
122122 if ( request . query . state ?. startsWith ( 'mobile_' ) ) {
123- return reply . redirect ( `${ mobileRedirect } ? token=${ token } ` ) ;
123+ return reply . redirect ( `${ mobileRedirect } # token=${ token } ` ) ;
124124 }
125125
126126 // For web: set cookie and redirect
@@ -222,7 +222,7 @@ export async function authRoutes(app: FastifyInstance) {
222222
223223 if ( request . query . state ?. startsWith ( 'mobile_' ) ) {
224224 const mobileRedirect = process . env . MOBILE_REDIRECT_URI ;
225- return reply . redirect ( `${ mobileRedirect } ? token=${ token } ` ) ;
225+ return reply . redirect ( `${ mobileRedirect } # token=${ token } ` ) ;
226226 }
227227
228228 reply . setCookie ( 'token' , token , {
You can’t perform that action at this time.
0 commit comments