refactor: use adonis's access tokens instead of creating custom (and unsecured) logic

This commit is contained in:
Sonny
2025-08-22 18:35:50 +02:00
parent d00b6b9edd
commit 9aa71dad30
19 changed files with 241 additions and 402 deletions

View File

@@ -8,10 +8,15 @@ export default class ShowUserSettingsController {
public async render({ auth, inertia }: HttpContext) {
const user = await auth.authenticate();
const tokens = await this.apiTokenService.getUserTokens(user.id);
const tokens = await this.apiTokenService.getTokens(user);
return inertia.render('user_settings/show', {
user,
tokens,
tokens: tokens.map((token) => {
return {
...token.toJSON(),
identifier: token.identifier,
};
}),
});
}
}