Scaffold @forte/admin package with React, Vite, shadcn/ui, TanStack Router
Sets up the admin frontend with login page, auth guard, API client, Zustand auth store, and all shadcn/ui components. Vite proxies /v1 to backend in dev.
This commit is contained in:
16
packages/admin/src/api/auth.ts
Normal file
16
packages/admin/src/api/auth.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { api } from '@/lib/api-client'
|
||||
|
||||
interface LoginResponse {
|
||||
token: string
|
||||
user: {
|
||||
id: string
|
||||
email: string
|
||||
firstName: string
|
||||
lastName: string
|
||||
role: string
|
||||
}
|
||||
}
|
||||
|
||||
export async function login(email: string, password: string): Promise<LoginResponse> {
|
||||
return api.post<LoginResponse>('/v1/auth/login', { email, password })
|
||||
}
|
||||
Reference in New Issue
Block a user