diff --git a/src/models/Session.ts b/src/models/Session.ts index 3171ec7..cd90527 100644 --- a/src/models/Session.ts +++ b/src/models/Session.ts @@ -1,4 +1,5 @@ import {model, ObjectId, Schema, Types} from "mongoose"; +import encrypt from "mongoose-encryption"; interface ISession { id: ObjectId, @@ -19,4 +20,9 @@ const SessionSchema = new Schema({ userAgent: String }); +SessionSchema.plugin(encrypt, { + encryptionKey: process.env.ENC_KEY, + signingKey: process.env.SIG_KEY +}); + export const Session = model('sessions', SessionSchema); \ No newline at end of file