mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-09-30 19:23:15 +00:00
- Rewrite theme with SHOC palette (#0c4f6f primary, Nunito font, 4px radius) - Add global CSS with Google Fonts import for Nunito - Redesign Topbar with avatar initials, role subtitle, gradient header - Redesign Sidebar with 220px width, section headers, active state border - Restyle LoginPage with SHOC branded card and dev-mode role selector - Update AdminDashboard KPI cards to centered SHOC style - Add devLogin API method for local development auth flow
33 lines
859 B
TypeScript
33 lines
859 B
TypeScript
import apiClient from './client';
|
|
|
|
export interface AuthUser {
|
|
id: string;
|
|
email: string;
|
|
displayName: string;
|
|
role: 'Dispatcher' | 'Admin' | 'SysAdmin';
|
|
token: string;
|
|
}
|
|
|
|
export interface UserProfile {
|
|
id: string;
|
|
email: string;
|
|
displayName: string;
|
|
role: 'Dispatcher' | 'Admin' | 'SysAdmin';
|
|
}
|
|
|
|
export const authApi = {
|
|
exchangeCode: async (code: string, redirectUri: string): Promise<AuthUser> => {
|
|
const res = await apiClient.post('/auth/callback', { code, redirectUri });
|
|
return res.data;
|
|
},
|
|
|
|
devLogin: async (email: string, displayName: string, role: string): Promise<AuthUser> => {
|
|
const res = await apiClient.post('/auth/dev-login', { email, displayName, role });
|
|
return res.data;
|
|
},
|
|
|
|
getMe: async (): Promise<UserProfile> => {
|
|
const res = await apiClient.get('/users/me');
|
|
return res.data;
|
|
},
|
|
};
|