Skip to content

Commit

Permalink
Unified the logic for verifying the route06 domain
Browse files Browse the repository at this point in the history
  • Loading branch information
satococoa committed Oct 22, 2024
1 parent 8624c0b commit 9472a11
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/(auth)/lib/is-route06-user.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use server";

import { getUser } from "@/lib/supabase";

const R06_EMAIL_DOMAIN = "route06.co.jp";
import { isEmailFromRoute06 } from "@/lib/utils";

export const isRoute06User = async () => {
const supabaseUser = await getUser();
Expand All @@ -12,6 +11,5 @@ export const isRoute06User = async () => {
throw new Error("No email found for user");
}

const emailDomain = email.split("@")[1];
return emailDomain === R06_EMAIL_DOMAIN;
return isEmailFromRoute06(email);
};

0 comments on commit 9472a11

Please sign in to comment.