apps/api: get-user: return data from db

This commit is contained in:
vchikalkin 2024-01-12 13:51:31 +03:00
parent 2f3f0183e5
commit 0643080e68

View File

@ -73,7 +73,11 @@ export class AccountService {
public async getUser(token: string) {
try {
return this.jwtService.verify(token);
const { username } = this.jwtService.verify(token) as TokenPayload;
return this.accountModel.find({
username,
});
} catch {
throw new UnauthorizedException('Invalid token');
}