Skip to content

Commit

Permalink
Fix Discord login not redirecting to /setup even if user had not yet …
Browse files Browse the repository at this point in the history
…set up
  • Loading branch information
yutotakano committed Dec 2, 2024
1 parent 880f034 commit d8b1a6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/routes/login_.discord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ export async function action({ request }: ActionFunctionArgs) {
session.set("user_id", temporary_user_id);
session.unset("temporary_user_id");

return redirect("/", {
// We deem a user verified when they have checked that they are both in Edinburgh
// and have an email address.
let verified = user.is_physically_in_edinburgh && user.email !== null;

return redirect(verified ? "/" : "/setup", {
headers: {
"Set-Cookie": await commitSession(session),
},
Expand Down

0 comments on commit d8b1a6e

Please sign in to comment.