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