feat(auth): endpoint /auth/me, cockpits renomeados e menu de logout
- GET /api/v1/auth/me retorna perfil real do ERP (vw_representantes) - Contrato UserProfile adicionado ao shared api-interface - Hook useCurrentUser() no frontend consome o endpoint - Cockpit rafael → rep, sandra → supervisor (pastas e componentes) - Topbar exibe iniciais do usuário e dropdown com nome, role e "Sair" - Logout limpa token e recarrega para voltar ao DevLogin Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,14 @@ export const AuthTokenResponseSchema = z.object({
|
||||
expiresIn: z.number().int().positive(),
|
||||
});
|
||||
|
||||
export const UserProfileSchema = z.object({
|
||||
codVendedor: z.number().int(),
|
||||
nome: z.string(),
|
||||
role: JwtRoleSchema,
|
||||
idEmpresa: z.number().int(),
|
||||
});
|
||||
|
||||
export type DevTokenRequest = z.infer<typeof DevTokenRequestSchema>;
|
||||
export type AuthTokenResponse = z.infer<typeof AuthTokenResponseSchema>;
|
||||
export type JwtRole = z.infer<typeof JwtRoleSchema>;
|
||||
export type UserProfile = z.infer<typeof UserProfileSchema>;
|
||||
|
||||
Reference in New Issue
Block a user