mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
add email login
This commit is contained in:
14
shared/schema/PasswordSchema.ts
Normal file
14
shared/schema/PasswordSchema.ts
Normal 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);
|
||||
|
||||
16
shared/schema/RegisterSchema.ts
Normal file
16
shared/schema/RegisterSchema.ts
Normal 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);
|
||||
|
||||
Reference in New Issue
Block a user