fix: authorize super admins by dynamic highest rank
This commit is contained in:
@@ -4,6 +4,5 @@ export interface ProxyToken {
|
||||
|
||||
export function shouldRedirectAdminRequest(pathname: string, token: ProxyToken | null): boolean {
|
||||
if (pathname !== "/admin" && !pathname.startsWith("/admin/")) return false;
|
||||
const rank = typeof token?.rank === "number" ? token.rank : Number(token?.rank);
|
||||
return !Number.isInteger(rank) || rank < 7;
|
||||
return token === null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user