Authentication entrypoints
Authentication entrypoints provide four public page variants for login and registration. They pair two visual versions with shared credential forms and a Google sign-in control. The main application also exposes an unauthorized destination for users who cannot view requested content.
Route versions
The authentication route set keeps login and registration in matching version pairs. Each version offers both actions, so a user can move between them without leaving the selected page style.
| Version | Login | Registration | Page purpose |
|---|---|---|---|
| v1 | /auth/v1/login | /auth/v1/register | Split-screen presentation with a branded panel and a form panel |
| v2 | /auth/v2/login | /auth/v2/register | Branded form presentation with a shared page frame, footer, and language display |
The version label selects the presentation of the entrypoint. The two versions use the same login and registration controls, so the route variants do not represent separate account rules in this area.
The application navigation exposes all four routes as separate authentication choices. These links open in a new tab, which lets an engineer compare the page variants without losing the current application view. See route composition for the wider relationship between application routes and navigation.
References: src/…/page.tsx• L18-54 src/…/page.tsx• L18-54 src/…/layout.tsx• L8-35 src/…/page.tsx• L20-54 src/…/page.tsx• L20-54 src/…/sidebar-items.ts• L200-208
Shared authentication controls
The shared controls keep the core login and registration experience consistent across both visual versions. Each page adds its own heading and navigation around these controls while the form rules stay the same.
Login form
The LoginForm collects an email address, a password, and an optional 30-day remember choice. It checks the email shape and requires a password of at least six characters before it accepts the form.
The current form gives immediate feedback through a toast that displays the submitted values. It does not connect to an account service or perform a post-login redirect in this area, so these entrypoints currently express the user flow rather than complete an authentication transaction.
References: src/…/login-form.tsx• L13-27 src/…/login-form.tsx• L29-103
Registration form
The RegisterForm collects an email address, a password, and a matching password confirmation. It requires a valid email and six-character minimum passwords, then rejects a confirmation that does not match the password.
Like the login form, registration reports accepted input through a toast instead of creating an account or navigating to another page. Both v1 and v2 therefore share one validation and feedback model.
References: src/…/register-form.tsx• L12-31 src/…/register-form.tsx• L33-104
Google sign-in control
The GoogleButton gives each entrypoint a consistent secondary sign-in choice. Login and registration pages place it beside the shared credential form, with v2 showing it before the credential fields and v1 showing it after them.
The control currently presents the provider action without a provider callback in this area. It is therefore a shared interface point for a future or external Google sign-in flow rather than evidence of a completed provider exchange.
References: src/…/google-button.tsx• L7-13 src/…/page.tsx• L41-48 src/…/page.tsx• L29-36 src/…/page.tsx• L28-42 src/…/page.tsx• L28-42
Unauthorized destination
The /unauthorized route is the common user-facing destination for an access denial. It explains that the requested content is not permitted and gives the user a path back to the dashboard. The page is also excluded from search indexing and link following through its metadata.
The destination does not decide why access failed. It presents the result of that decision in a clear state and offers a Go to Homepage link whose target is dashboard for recovery. This makes it part of the main application’s route surface even though it is separate from the login and registration pages.
References: src/…/page.tsx• L6-11 src/…/page.tsx• L13-34
Authentication page relationships
The route variants, shared controls, and denial destination form separate parts of the user access surface. The diagram shows the high-level paths without implying that the current forms complete a server-side sign-in or registration flow.
flowchart TD
A[Authentication choice] --> B[/auth/v1/login]
A --> C[/auth/v1/register]
A --> D[/auth/v2/login]
A --> E[/auth/v2/register]
B --> F[Shared login controls]
C --> G[Shared registration controls]
D --> F
E --> G
F --> H[Validation and toast feedback]
G --> H
I[Main application route] -->|access denied| J[/unauthorized]
J --> K[/dashboard]
For the shell that hosts the main application routes, see application shell. For the rules that combine route groups and page entrypoints, see route composition.
References: src/…/page.tsx• L41-48 src/…/page.tsx• L29-36 src/…/page.tsx• L28-42 src/…/page.tsx• L28-42 src/…/page.tsx• L15-30
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the login and registration links paired within each version. Relative links must continue to resolve to the same version’s page.
- Keep v1 and v2 page contracts aligned with the shared form fields. A visual variant should not silently change validation or feedback behavior.
- If a real sign-in or registration service is added, replace the current toast-only outcome with a defined success path and failure path for every entrypoint.
- If access checks begin redirecting to
/unauthorized, keep the denial route and its dashboard recovery link aligned with the main route map. - When an authentication route is added or removed, update the authentication choices in the main navigation so the public route surface stays complete.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A version page points its account switch link to the wrong relative route | Users leave the selected visual version when they switch between login and registration | Keep login and register links local to the same /auth/v1 or /auth/v2 pair |
| A form change bypasses the shared validation rules | v1 and v2 can accept different account data for the same action | Make both page variants continue to use the shared form component |
| A denied route loses its dashboard link | Users reach an access error with no clear recovery path | Preserve the /unauthorized destination and its dashboard link |
| A provider button is treated as a working sign-in flow without a provider handler | Users see a sign-in choice but no account transaction completes | Connect the control to an explicit provider flow before describing Google sign-in as active |
Key files
| File | Why to read it |
|---|---|
| src/…/page.tsx | Shows the v1 login entrypoint and its link to registration |
| src/…/page.tsx | Shows the v1 registration entrypoint and its link to login |
| src/…/layout.tsx | Defines the shared v2 page frame around both v2 entrypoints |
| src/…/page.tsx | Shows the v2 login composition and provider-first presentation |
| src/…/page.tsx | Shows the v2 registration composition and provider-first presentation |
| src/…/login-form.tsx | Defines the shared login fields, validation, and current feedback behavior |
| src/…/register-form.tsx | Defines the shared registration fields, validation, and current feedback behavior |
| src/…/google-button.tsx | Defines the shared Google sign-in control |
| src/…/page.tsx | Defines the access-denied destination, search visibility, and dashboard recovery link |
| src/…/sidebar-items.ts | Exposes the four authentication routes from the main navigation |