@@ -8,7 +8,11 @@ const requestParamsSchema = z
88 code_challenge : z . string ( ) ,
99 code_challenge_method : z . string ( ) ,
1010 redirect_uri : z . string ( ) ,
11- scope : z . string ( ) . optional ( ) . default ( '' ) . transform ( s => s ? s . split ( ' ' ) : [ ] ) ,
11+ scope : z
12+ . string ( )
13+ . optional ( )
14+ . default ( '' )
15+ . transform ( ( s ) => ( s ? s . split ( ' ' ) : [ ] ) ) ,
1216 state : z . string ( ) . optional ( ) . default ( '' ) ,
1317 user_id : z . string ( ) . optional ( ) , // For programmatic testing
1418 } )
@@ -35,7 +39,7 @@ const requestParamsSchema = z
3539
3640export async function loader ( { request, context } : Route . LoaderArgs ) {
3741 const url = new URL ( request . url )
38-
42+
3943 try {
4044 const requestParams = requestParamsSchema . parse (
4145 Object . fromEntries ( url . searchParams ) ,
@@ -74,8 +78,11 @@ export async function loader({ request, context }: Route.LoaderArgs) {
7478 } catch ( error ) {
7579 console . error ( 'Error in test-auth:' , error )
7680 return Response . json (
77- { error : 'Failed to complete authorization' , details : error instanceof Error ? error . message : String ( error ) } ,
81+ {
82+ error : 'Failed to complete authorization' ,
83+ details : error instanceof Error ? error . message : String ( error ) ,
84+ } ,
7885 { status : 500 } ,
7986 )
8087 }
81- }
88+ }
0 commit comments