feat(frontend): implement auth store and login page
Rewrites auth store with typed AuthUser shape (id, name, isAdmin) and localStorage persistence. Adds login page with tanabata decorative images, centered form, purple primary button matching the reference design. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import { writable, derived } from 'svelte/store';
|
||||
import type { User } from '$lib/api/types';
|
||||
|
||||
export interface AuthUser {
|
||||
id: number;
|
||||
name: string;
|
||||
isAdmin: boolean;
|
||||
}
|
||||
|
||||
export interface AuthState {
|
||||
accessToken: string | null;
|
||||
refreshToken: string | null;
|
||||
user: User | null;
|
||||
user: AuthUser | null;
|
||||
}
|
||||
|
||||
const initial: AuthState = { accessToken: null, refreshToken: null, user: null };
|
||||
|
||||
Reference in New Issue
Block a user