change jwt data

This commit is contained in:
rubikscraft
2022-03-21 23:23:32 +01:00
parent d11c8f9083
commit 0b65d496c3
4 changed files with 19 additions and 14 deletions

View File

@@ -29,15 +29,18 @@ export class SimpleUser extends SimpleUsername {
password: string;
}
// Actual entity that goes in the db
export class EUser extends SimpleUsername {
@IsOptional()
@IsInt()
id?: number;
// Add a user object with just the username and roles for jwt
export class RoledUser extends SimpleUsername {
@IsArray()
@IsString({ each: true })
roles: Roles;
}
// Actual entity that goes in the db
export class EUser extends RoledUser {
@IsOptional()
@IsInt()
id?: number;
@IsOptional()
@Exclude()