feat(api-token) : génération du token MCP depuis la page profil
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Backend : - POST /api/me/regenerate-api-token : nouveau controller, ROLE_USER (exclut CLIENT) - User.apiToken exposé via groupe me:read sur GET /api/me Frontend : - Section 'Token API MCP' sur /profile (masquée pour les CLIENT du portail) - Boutons Copier + Régénérer avec modal de confirmation - Service api-token + DTO mis à jour + clés i18n fr
This commit is contained in:
12
frontend/services/api-token.ts
Normal file
12
frontend/services/api-token.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export function useApiTokenService() {
|
||||
const api = useApi()
|
||||
|
||||
async function regenerate(): Promise<string> {
|
||||
const data = await api.post<{ apiToken: string }>('/me/regenerate-api-token', {}, {
|
||||
toast: false,
|
||||
})
|
||||
return data.apiToken
|
||||
}
|
||||
|
||||
return { regenerate }
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export type UserData = {
|
||||
client?: { id: number; name: string } | null
|
||||
allowedProjects?: Project[]
|
||||
avatarUrl?: string | null
|
||||
apiToken?: string | null
|
||||
}
|
||||
|
||||
export type UserWrite = {
|
||||
|
||||
Reference in New Issue
Block a user