Created the Account.ts model

This commit is contained in:
2023-01-14 23:15:33 +01:00
parent f237a5f5a0
commit 3dc20be029

27
src/models/Account.ts Normal file
View File

@ -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<IAccount>({
username: {
type: String,
required: true
},
email: {
type: String,
required: true,
},
password: {
type: String,
required: true
},
totpSecret: String
});
export const Account = model<IAccount>("accounts", AccountSchema);