diff options
Diffstat (limited to 'src/server/authentication')
-rw-r--r-- | src/server/authentication/controllers/user.ts | 2 | ||||
-rw-r--r-- | src/server/authentication/models/User.ts | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/server/authentication/controllers/user.ts b/src/server/authentication/controllers/user.ts index 590224fb0..f74ff9039 100644 --- a/src/server/authentication/controllers/user.ts +++ b/src/server/authentication/controllers/user.ts @@ -17,7 +17,7 @@ export let getSignup = (req: Request, res: Response) => { return res.redirect("/"); } res.render("signup.pug", { - title: "Create Account" + title: "Sign Up" }); }; diff --git a/src/server/authentication/models/User.ts b/src/server/authentication/models/User.ts index 9f58d317d..9752c4260 100644 --- a/src/server/authentication/models/User.ts +++ b/src/server/authentication/models/User.ts @@ -1,7 +1,21 @@ +//@ts-ignore import * as bcrypt from "bcrypt-nodejs"; import * as crypto from "crypto"; +//@ts-ignore import * as mongoose from "mongoose"; +var url = 'mongodb://localhost:27017/Dash' +mongoose.connect(url, { useNewUrlParser: true }); + +mongoose.connection.on('connected', function () { + console.log('Stablished connection on ' + url); +}); +mongoose.connection.on('error', function (error) { + console.log('Something wrong happened: ' + error); +}); +mongoose.connection.on('disconnected', function () { + console.log('connection closed'); +}); export type UserModel = mongoose.Document & { email: string, password: string, @@ -18,7 +32,6 @@ export type UserModel = mongoose.Document & { }, comparePassword: comparePasswordFunction, - gravatar: (size: number) => string }; type comparePasswordFunction = (candidatePassword: string, cb: (err: any, isMatch: any) => {}) => void; |