add email login

This commit is contained in:
Emily
2024-10-10 15:49:55 +02:00
parent 0a7f2b58d0
commit 80e3b0caa9
14 changed files with 531 additions and 27 deletions

View File

@@ -0,0 +1,14 @@
import { model, Schema, Types } from 'mongoose';
export type TPassword = {
email: string,
password: string,
}
const PasswordSchema = new Schema<TPassword>({
email: { type: String, index: true, unique: true },
password: { type: String },
});
export const PasswordModel = model<TPassword>('passwords', PasswordSchema);

View File

@@ -0,0 +1,16 @@
import { model, Schema, Types } from 'mongoose';
export type TRegister = {
email: string,
password: string,
created_at: Date
}
const RegisterSchema = new Schema<TRegister>({
email: { type: String },
password: { type: String },
created_at: { type: Date, default: () => Date.now() }
});
export const RegisterModel = model<TRegister>('registers', RegisterSchema);