aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/oauth/refresh/+server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/api/oauth/refresh/+server.ts')
-rw-r--r--src/routes/api/oauth/refresh/+server.ts4
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);
};