Remove redirect to login on Admin when not authenticated; show inline access denied or loading
cgen-1023d43dfd02419cbfc79d29929a6f5a
This commit is contained in:
parent
e4da7c8f65
commit
f05712ec39
1 changed files with 3 additions and 7 deletions
|
|
@ -211,11 +211,7 @@ export default function Admin() {
|
|||
}, [loadOpportunityApplications]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading) {
|
||||
if (!user) {
|
||||
navigate("/login", { replace: true });
|
||||
}
|
||||
}
|
||||
// Do not redirect unauthenticated users; show inline access UI instead
|
||||
}, [user, loading, navigate]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -224,7 +220,7 @@ export default function Admin() {
|
|||
}
|
||||
}, [managedProfiles, selectedMemberId]);
|
||||
|
||||
if (loading || !user) {
|
||||
if (loading) {
|
||||
return (
|
||||
<LoadingScreen
|
||||
message="Verifying admin access..."
|
||||
|
|
@ -234,7 +230,7 @@ export default function Admin() {
|
|||
);
|
||||
}
|
||||
|
||||
if (!isOwner) {
|
||||
if (!user || !isOwner) {
|
||||
return (
|
||||
<Layout>
|
||||
<div className="min-h-screen bg-aethex-gradient py-12">
|
||||
|
|
|
|||
Loading…
Reference in a new issue