feat(ui-admin): require auth for all admin pages and fix header text …#372
Merged
jasonmorais merged 2 commits intomainfrom Apr 17, 2026
Merged
feat(ui-admin): require auth for all admin pages and fix header text …#372jasonmorais merged 2 commits intomainfrom
jasonmorais merged 2 commits intomainfrom
Conversation
…size - Wrap AppRoutes in RequireAuth with redirectPath=/login so all admin pages require authentication including the home page - Update listing-operations and user-operations redirect paths from / to /login - Remove redundant RequireAuth wrapper from messages route in app-routes.tsx - Remove unused isAuthenticated prop from App component and its caller - Fix admin header .brandName font-size from 1.1rem to 24px, add line-height: 32px, and update color to match canonical .logoText style Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideWraps all admin routes (including the root) with a shared RequireAuth guard redirecting to /login, simplifies App component props/callers, removes a redundant inner auth wrapper from the messages route, and aligns the admin header brandName styling with the canonical logo text styles. Sequence diagram for updated admin route authentication flowsequenceDiagram
actor AdminUser
participant Browser
participant App
participant RequireAuth
participant AppRoutes
participant MessagesRoutes
participant LoginPage as AdminLogin
AdminUser->>Browser: Navigate to /messages
Browser->>App: Load React app
App->>RequireAuth: Render appSection with redirectPath /login
RequireAuth->>RequireAuth: Check auth state
alt not authenticated
RequireAuth-->>Browser: Redirect to /login
Browser->>LoginPage: Render AdminLogin
else authenticated
RequireAuth->>AppRoutes: Render child routes
AppRoutes->>MessagesRoutes: Render messages/* route without inner guard
MessagesRoutes-->>AdminUser: Show messages UI
end
Class diagram for updated admin routing and auth componentsclassDiagram
class AppContainer {
+AppContainer()
}
class App {
+App()
}
class RequireAuth {
+redirectPath string
+children ReactNode
}
class AppRoutes {
+AppRoutes()
}
class ListingOperationsRoutes {
+ListingOperationsRoutes()
}
class UserOperationsRoutes {
+UserOperationsRoutes()
}
class MessagesRoutes {
+MessagesRoutes()
}
class AdminLogin {
+AdminLogin()
}
class AuthRedirect {
+AuthRedirect()
}
AppContainer --> App : renders
App o--> RequireAuth : appSection
App o--> RequireAuth : listingOperationsSection
App o--> RequireAuth : userOperationsSection
App --> AdminLogin : /login route
App --> AuthRedirect : /auth-redirect route
App --> AppRoutes : protected root routes
App --> ListingOperationsRoutes : protected listing routes
App --> UserOperationsRoutes : protected user routes
AppRoutes --> MessagesRoutes : messages/* route without RequireAuth
RequireAuth --> AppRoutes : children when authenticated
RequireAuth --> ListingOperationsRoutes : children when authenticated
RequireAuth --> UserOperationsRoutes : children when authenticated
note for AppContainer "No longer passes isAuthenticated prop to App"
note for App "Has no props; all routes now protected via top-level RequireAuth with redirectPath /login"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…size
Summary by Sourcery
Enforce authentication across all admin routes and align the admin header branding styles with the canonical design.
Enhancements: