Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed Dec 15, 2024
1 parent ec5133a commit e5b7b88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 9 additions & 0 deletions pageTemplates/home/HomeInitialSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ function HomeInitialSetting() {
const isPWALogin = isPWA();

useEffect(() => {
if (userInfo?.role === "newUser") {
router.push("/register/name");
return;
}

if (userInfo?.role === "waiting") {
router.push("/login?status=waiting");
return;
}
if (userInfo?.role === "human") {
if (isPWALogin) {
setRole({ role: "member" });
Expand Down
10 changes: 1 addition & 9 deletions pageTemplates/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,7 @@ function Layout({ children }: ILayout) {
return;
}
if (status === "loading" || session === undefined) return;
const role = session?.user.role;
if (role === "newUser") {
router.push("/register/name");
return;
}
if (role === "waiting") {
router.push("/login?status=waiting");
return;
}

if (!session?.user?.location) {
toast(
"warning",
Expand Down

0 comments on commit e5b7b88

Please sign in to comment.