Skip to content

Commit

Permalink
Fix redirect not happening properly on failures to join
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraiSubject committed Mar 16, 2023
1 parent 2e55f45 commit 906609c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/webstack/src/routes/auth/discord/callback/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ export const GET = (async ({ url, locals }) => {

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

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

0 comments on commit 906609c

Please sign in to comment.