Encrypted the Account.ts
This commit is contained in:
parent
00c00d40a2
commit
0aff108ada
@ -1,4 +1,5 @@
|
||||
import {Schema, ObjectId, model} from "mongoose";
|
||||
import encrypt from "mongoose-encryption";
|
||||
|
||||
export interface IAccount {
|
||||
id: ObjectId,
|
||||
@ -24,4 +25,9 @@ const AccountSchema = new Schema<IAccount>({
|
||||
totpSecret: String
|
||||
});
|
||||
|
||||
AccountSchema.plugin(encrypt, {
|
||||
encryptionKey: process.env.ENC_KEY,
|
||||
signingKey: process.env.SIG_KEY
|
||||
});
|
||||
|
||||
export const Account = model<IAccount>("accounts", AccountSchema);
|
Loading…
x
Reference in New Issue
Block a user