diff --git a/src/models/Account.ts b/src/models/Account.ts index 4a132da..749a620 100644 --- a/src/models/Account.ts +++ b/src/models/Account.ts @@ -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({ totpSecret: String }); +AccountSchema.plugin(encrypt, { + encryptionKey: process.env.ENC_KEY, + signingKey: process.env.SIG_KEY +}); + export const Account = model("accounts", AccountSchema); \ No newline at end of file