From 0aff108adabecbbe6f1ba18a7e27316249193710 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 15 Jan 2023 00:23:40 +0100 Subject: [PATCH] Encrypted the Account.ts --- src/models/Account.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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