wip
This commit is contained in:
@@ -9,7 +9,8 @@ export async function GET(request: Request) {
|
||||
const url = new URL(request.url);
|
||||
const code = url.searchParams.get('code') ?? undefined;
|
||||
const state = url.searchParams.get('state') ?? undefined;
|
||||
const returnTo = url.searchParams.get('returnTo') ?? undefined;
|
||||
const rawReturnTo = url.searchParams.get('returnTo');
|
||||
const returnTo = rawReturnTo ?? undefined;
|
||||
|
||||
if (!code || !state) {
|
||||
return NextResponse.redirect('/auth/iracing');
|
||||
@@ -23,7 +24,8 @@ export async function GET(request: Request) {
|
||||
}
|
||||
|
||||
const authService = getAuthService();
|
||||
await authService.loginWithIracingCallback({ code, state, returnTo });
|
||||
const loginInput = returnTo ? { code, state, returnTo } : { code, state };
|
||||
await authService.loginWithIracingCallback(loginInput);
|
||||
|
||||
cookieStore.delete(STATE_COOKIE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user