Encrypted the License.ts

This commit is contained in:
Mathias Wagner 2023-01-15 00:26:28 +01:00
parent 0aff108ada
commit 6a9b3c2c5e
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -1,4 +1,5 @@
import {model, ObjectId, Schema, Types} from "mongoose";
import encrypt from 'mongoose-encryption';
export enum ILicenseMetaType {
STRING
@ -38,4 +39,9 @@ const LicenseSchema = new Schema<ILicense>({
}
});
export const Account = model<ILicense>("licenses", LicenseSchema);
LicenseSchema.plugin(encrypt, {
encryptionKey: process.env.ENC_KEY,
signingKey: process.env.SIG_KEY
});
export const License = model<ILicense>("licenses", LicenseSchema);