apps/api: get-user: return data from db
This commit is contained in:
parent
2f3f0183e5
commit
0643080e68
@ -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');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user