fix: require auth before rendering admin dashboard
Show login instead of AdminDashboard on /admin when unauthenticated to avoid pointless admin API calls. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -563,6 +563,14 @@ function App() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isAdminRoute) {
|
if (isAdminRoute) {
|
||||||
|
if (!isAuthenticated) {
|
||||||
|
return (
|
||||||
|
<div className="auth-screen">
|
||||||
|
<AuthOnboarding onAuthenticated={handleAuthenticated} onOpenDemo={openDemo} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'contents' }}>
|
<div style={{ display: 'contents' }}>
|
||||||
<AdminDashboard onBack={handleBackFromAdmin} />
|
<AdminDashboard onBack={handleBackFromAdmin} />
|
||||||
|
|||||||
Reference in New Issue
Block a user