feat(F-050): completed feature
This commit is contained in:
@@ -47,12 +47,15 @@ export const api = {
|
||||
|
||||
// ── Auth ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
// FIX-14: admin panel auth resolves through the backoffice endpoint.
|
||||
const BACKOFFICE_AUTH_BASE = '/api/backoffice/auth';
|
||||
|
||||
export const authApi = {
|
||||
login: (email: string, password: string) =>
|
||||
api.post<{ id: string; email: string; role: string }>('/api/auth/login', { email, password }),
|
||||
logout: () => api.post('/api/auth/logout'),
|
||||
api.post<{ id: string; email: string; role: string }>(`${BACKOFFICE_AUTH_BASE}/login`, { email, password }),
|
||||
logout: () => api.post(`${BACKOFFICE_AUTH_BASE}/logout`),
|
||||
me: () =>
|
||||
api.get<{ id: string; email: string; role: string } | { user: null }>('/api/auth/me'),
|
||||
api.get<{ id: string; email: string; role: string } | { user: null }>(`${BACKOFFICE_AUTH_BASE}/me`),
|
||||
};
|
||||
|
||||
// ── Products ──────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user