refactor(auth-token): lazy-load relations

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-11-16 18:39:52 +01:00
parent 6a56599c8a
commit 552d06f182
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 15 additions and 11 deletions

View file

@ -53,7 +53,11 @@ export class AuthService {
}
const accessToken = await this.getAuthTokenAndValidate(keyId, secret);
await this.setLastUsedToken(keyId);
return await this.usersService.getUserByUsername(accessToken.user.username);
return await this.usersService.getUserByUsername(
(
await accessToken.user
).username,
);
}
async createTokenForUser(