Important: When you begin this ticket, create a new branch from feat/admin-auth and not main. When you open a PR, open it into feat/admin-auth and not main.
Description
Replace the bare wrapper div in src/app/admin/layout.tsx with a functional admin shell that displays the current user, provides navigation, and allows logout.
Requirements
- Call
getSession() in the layout to identify the current admin
- Display the admin's name (will require looking up the admin by ID from the session — add a call to
findAdminById from adminRepository)
- Render nav links: "Members" linking to
/admin/members (blog/emails can be added later on)
- Add a logout button implemented as a
<form> with a server action that calls logoutAdmin() then redirects to /admin/login
- Must work without client JavaScript - the logout must be a real
<form> submission, not an onClick handler
Acceptance Criteria
Notes
The login page sits under (public)/login/ route group, so it uses a different layout chain and won't inherit this nav - that's already handled by the folder structure.
Important: When you begin this ticket, create a new branch from feat/admin-auth and not main. When you open a PR, open it into feat/admin-auth and not main.
Description
Replace the bare wrapper
divinsrc/app/admin/layout.tsxwith a functional admin shell that displays the current user, provides navigation, and allows logout.Requirements
getSession()in the layout to identify the current adminfindAdminByIdfromadminRepository)/admin/members(blog/emails can be added later on)<form>with a server action that callslogoutAdmin()then redirects to/admin/login<form>submission, not anonClickhandlerAcceptance Criteria
/admin/members/admin/loginNotes
The login page sits under
(public)/login/route group, so it uses a different layout chain and won't inherit this nav - that's already handled by the folder structure.