Skip to content

Commit

Permalink
Revert "Add UserRefreshState LoggedInForceAccountRedir for ToH"
Browse files Browse the repository at this point in the history
This reverts commit 6a9e4a2.
  • Loading branch information
lil5 committed Jan 30, 2024
1 parent 6a9e4a2 commit 8e3dbe8
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions frontend/src/providers/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export enum UserRefreshState {
NeverLoggedIn,
LoggedIn,
ForceLoggedOut,
LoggedInForceAccountRedir,
}

export type AuthProps = {
Expand Down Expand Up @@ -109,12 +108,6 @@ export function AuthProvider({ children }: PropsWithChildren<{}>) {
i18n: i18n.language,
});
}
if (!user.accepted_toh) {
const isAnyChainAdmin = !!user.chains.find((uc) => !!uc.chain_uid);
if (isAnyChainAdmin) {
return UserRefreshState.LoggedInForceAccountRedir;
}
}
} catch (err) {
await authLogout().catch((err) => {
console.error("force logout failed:", err);
Expand All @@ -136,13 +129,6 @@ export function AuthProvider({ children }: PropsWithChildren<{}>) {
if (!(isHome || isHomeI18n)) {
history.push("/");
}
} else if (res === UserRefreshState.LoggedInForceAccountRedir) {
const isAdminI18n =
history.location.pathname.substring(3) === "/admin/dashboard";
const isAdmin = history.location.pathname === "/admin/dashboard";
if (!(isAdmin || isAdminI18n)) {
history.push("/admin/dashboard");
}
}
});

Expand Down

0 comments on commit 8e3dbe8

Please sign in to comment.