diff options
| author | Fuwn <[email protected]> | 2023-12-15 23:58:50 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-12-15 23:58:50 -0800 |
| commit | b1cc0e327aba62dbeb43b1dd2aa910341bc96aa0 (patch) | |
| tree | f0bcbe1c7cd7fd25bc8c428d8abf08e609f8ae39 /src/routes/api/oauth/refresh/+server.ts | |
| parent | feat(notifications): refresh token (diff) | |
| download | due.moe-b1cc0e327aba62dbeb43b1dd2aa910341bc96aa0.tar.xz due.moe-b1cc0e327aba62dbeb43b1dd2aa910341bc96aa0.zip | |
feat(error): more error debugging
Diffstat (limited to 'src/routes/api/oauth/refresh/+server.ts')
| -rw-r--r-- | src/routes/api/oauth/refresh/+server.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/routes/api/oauth/refresh/+server.ts b/src/routes/api/oauth/refresh/+server.ts index ceb2566d..8bfac6e6 100644 --- a/src/routes/api/oauth/refresh/+server.ts +++ b/src/routes/api/oauth/refresh/+server.ts @@ -1,6 +1,7 @@ import { dev } from '$app/environment'; import { env } from '$env/dynamic/private'; import { env as env2 } from '$env/dynamic/public'; +import { redirect } from '@sveltejs/kit'; export const GET = async ({ url, cookies }) => { const formData = new FormData(); @@ -25,5 +26,6 @@ export const GET = async ({ url, cookies }) => { secure: !dev }); - return Response.json(newUser); + if (url.searchParams.get('redirect')) throw redirect(303, '/'); + else return Response.json(newUser); }; |