From 3dc20be0297f4089d8ab20af3b851946f0b0db2a Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 14 Jan 2023 23:15:33 +0100 Subject: [PATCH] Created the Account.ts model --- src/models/Account.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/models/Account.ts diff --git a/src/models/Account.ts b/src/models/Account.ts new file mode 100644 index 0000000..4a132da --- /dev/null +++ b/src/models/Account.ts @@ -0,0 +1,27 @@ +import {Schema, ObjectId, model} from "mongoose"; + +export interface IAccount { + id: ObjectId, + username: string, + email: string, + password: string, + totpSecret?: string +} + +const AccountSchema = new Schema({ + username: { + type: String, + required: true + }, + email: { + type: String, + required: true, + }, + password: { + type: String, + required: true + }, + totpSecret: String +}); + +export const Account = model("accounts", AccountSchema); \ No newline at end of file