Created the Account.ts model
This commit is contained in:
27
src/models/Account.ts
Normal file
27
src/models/Account.ts
Normal 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);
|
Reference in New Issue
Block a user