Skip to content

Commit 906609c

Browse files
committed
Fix redirect not happening properly on failures to join
1 parent 2e55f45 commit 906609c

File tree

1 file changed

+2
-2
lines changed
  • apps/webstack/src/routes/auth/discord/callback

1 file changed

+2
-2
lines changed

apps/webstack/src/routes/auth/discord/callback/+server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ export const GET = (async ({ url, locals }) => {
155155

156156
if (result === BotResult.Full) {
157157
locals.session.data.error = "You have joined the maxmium amount of servers. Please leave a server before trying to rejoin this one."
158-
return Response.redirect('/');
158+
throw redirect(302, '/');
159159
} else if (result === BotResult.Error) {
160160
locals.session.data.error = "An unknown error occured while trying to join the server."
161-
return Response.redirect('/');
161+
throw redirect(302, '/');
162162
}
163163

164164
console.log(`Discord User joined: ${meData.user.id} - ${meData.user.username}`);

0 commit comments

Comments
 (0)