apps/api: account: remove db props from token payload
This commit is contained in:
parent
f19f7af6a0
commit
f7ab0dc2d7
@ -48,7 +48,7 @@ export class AccountService {
|
||||
|
||||
const payload: TokenPayload = {
|
||||
username: login,
|
||||
...omit(account.toJSON(), ['password']),
|
||||
...omit(account.toJSON(), ['password', '_id', '__v']),
|
||||
};
|
||||
|
||||
return this.jwtService.sign(payload);
|
||||
|
||||
@ -11,12 +11,14 @@ export class Account {
|
||||
@ApiResponseProperty()
|
||||
@ApiProperty()
|
||||
@Prop({ index: { unique: true }, required: true })
|
||||
username: string;
|
||||
public username: string;
|
||||
|
||||
@ApiResponseProperty()
|
||||
@ApiProperty()
|
||||
@Prop({ required: true })
|
||||
password: string;
|
||||
public password: string;
|
||||
|
||||
readonly [key: string]: unknown;
|
||||
}
|
||||
|
||||
export const AccountSchema = SchemaFactory.createForClass(Account);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user