mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 22:53:25 +00:00
refactor: use adonis's access tokens instead of creating custom (and unsecured) logic
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user