Skip to content

feat : add authenticated admin access boundaries#61

Open
SYLVIANNORUKA wants to merge 1 commit into
Adamantine-guild:mainfrom
SYLVIANNORUKA:issue#23
Open

feat : add authenticated admin access boundaries#61
SYLVIANNORUKA wants to merge 1 commit into
Adamantine-guild:mainfrom
SYLVIANNORUKA:issue#23

Conversation

@SYLVIANNORUKA

Copy link
Copy Markdown

##Summary
-Management routes (/passes, /guilds, /members, /activity, /settings) are now protected by a shared AdminGuard component — unauthenticated visitors see a clear access-denied screen instead of the raw page content
-Added getSession(): Session | null to lib/auth/session.ts as the single pluggable auth entry point — swapping in real auth (next-auth, SIWE, JWT) only requires changing this one function
-Added MOCK_ADMIN_MODE flag driven by NEXT_PUBLIC_MOCK_ADMIN=true in .env.local so the guard can be bypassed locally without hard-coding credentials
-AdminGuard lives inside DashboardLayout, so the boundary is inherited by every management page with zero per-page duplication
-Updated useSession() to return Session | null (null = unauthenticated) and updated the three pages that called it (passes, members, settings) to handle the null case safely.
closes #23

@Lakes41 Lakes41 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job, Do resolve conflicts @SYLVIANNORUKA

@Lakes41

Lakes41 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@SYLVIANNORUKA Do resolve conflicts, I might have to take you off when it 24 hours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add authenticated admin access boundaries

2 participants