Modify service token format

This commit is contained in:
Tuan Dang
2023-01-02 22:43:00 +07:00
parent b8a64714d2
commit e99ee94a7b
7 changed files with 41 additions and 38 deletions
+2 -7
View File
@@ -7,8 +7,7 @@ export interface IServiceTokenData {
environment: string; // TODO: adapt to upcoming environment id
user: Types.ObjectId;
expiresAt: Date;
prefix: string;
serviceTokenHash: string;
secretHash: string;
encryptedKey: string;
iv: string;
tag: string;
@@ -37,11 +36,7 @@ const serviceTokenDataSchema = new Schema<IServiceTokenData>(
expiresAt: {
type: Date
},
prefix: {
type: String,
required: true
},
serviceTokenHash: {
secretHash: {
type: String,
unique: true,
required: true,