proposal-system/web/src/lib/api/auth.ts
Adam Moussa 3e9623b6fc Apply SHOC design system styling across frontend
- 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
2026-05-16 22:10:52 -04:00

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;
},
};