Remove redirect to login on Admin when not authenticated; show inline access denied or loading

cgen-1023d43dfd02419cbfc79d29929a6f5a
This commit is contained in:
Builder.io 2025-10-19 05:09:50 +00:00
parent e4da7c8f65
commit f05712ec39

View file

@ -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">