From adc70137f01072271672be1b4bf1b823b1b28060 Mon Sep 17 00:00:00 2001 From: Mohammad Amoush Date: Tue, 16 Jul 2019 13:31:55 -0400 Subject: reverted user controller email format --- src/server/authentication/controllers/user_controller.ts | 6 +++--- src/server/authentication/models/user_model.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/authentication/controllers/user_controller.ts b/src/server/authentication/controllers/user_controller.ts index fa1cd647d..0e431f1e6 100644 --- a/src/server/authentication/controllers/user_controller.ts +++ b/src/server/authentication/controllers/user_controller.ts @@ -52,7 +52,7 @@ export let postSignup = (req: Request, res: Response, next: NextFunction) => { const password = req.body.password; const model = { - email: { type: email, unique: true }, + email, password, userDocumentId: Utils.GenerateGuid() } as Partial; @@ -186,7 +186,7 @@ export let postForgot = function (req: Request, res: Response, next: NextFunctio } }); const mailOptions = { - to: user.email.type, + to: user.email, from: 'brownptcdash@gmail.com', subject: 'Dash Password Reset', text: 'You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n' + @@ -259,7 +259,7 @@ export let postReset = function (req: Request, res: Response) { } }); const mailOptions = { - to: user.email.type, + to: user.email, from: 'brownptcdash@gmail.com', subject: 'Your password has been changed', text: 'Hello,\n\n' + diff --git a/src/server/authentication/models/user_model.ts b/src/server/authentication/models/user_model.ts index fb62de1c8..45fbf23b1 100644 --- a/src/server/authentication/models/user_model.ts +++ b/src/server/authentication/models/user_model.ts @@ -16,7 +16,7 @@ mongoose.connection.on('disconnected', function () { console.log('connection closed'); }); export type DashUserModel = mongoose.Document & { - email: { type: String, unique: true }, + email: String, password: string, passwordResetToken?: string, passwordResetExpires?: Date, @@ -42,7 +42,7 @@ export type AuthToken = { }; const userSchema = new mongoose.Schema({ - email: { type: String, unique: true }, + email: String, password: String, passwordResetToken: String, passwordResetExpires: Date, -- cgit v1.2.3-70-g09d2