aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/authentication/controllers/user.ts14
-rw-r--r--src/server/authentication/models/User.ts2
-rw-r--r--views/stylesheets/authentication.css3
3 files changed, 8 insertions, 11 deletions
diff --git a/src/server/authentication/controllers/user.ts b/src/server/authentication/controllers/user.ts
index 2f97f4d53..1ce82a911 100644
--- a/src/server/authentication/controllers/user.ts
+++ b/src/server/authentication/controllers/user.ts
@@ -3,10 +3,7 @@ import { Request, Response, NextFunction } from "express";
import * as passport from "passport";
import { IVerifyOptions } from "passport-local";
import "../config/passport";
-import * as request from "express-validator";
const flash = require("express-flash");
-import * as session from "express-session";
-import * as pug from 'pug';
/**
* GET /
@@ -25,7 +22,6 @@ export let getEntry = (req: Request, res: Response) => {
export let getSignup = (req: Request, res: Response) => {
if (req.user) {
let user = req.user;
- console.log(user);
return res.redirect("/home");
}
res.render("signup.pug", {
@@ -61,11 +57,8 @@ export let postSignup = (req: Request, res: Response, next: NextFunction) => {
const user = new User({
email,
- password
+ password,
});
-
- const please_work = "cool@gmail.com"
-
User.findOne({ email }, (err, existingUser) => {
if (err) { return next(err); }
if (existingUser) {
@@ -116,14 +109,13 @@ export let postLogin = (req: Request, res: Response, next: NextFunction) => {
if (errors) {
req.flash("errors", "Unable to login at this time. Please try again.");
- return res.redirect("/login");
+ return res.redirect("/signup");
}
passport.authenticate("local", (err: Error, user: UserModel, info: IVerifyOptions) => {
if (err) { return next(err); }
if (!user) {
- req.flash("errors", info.message);
- return res.redirect("/login");
+ return res.redirect("/signup");
}
req.logIn(user, (err) => {
if (err) { return next(err); }
diff --git a/src/server/authentication/models/User.ts b/src/server/authentication/models/User.ts
index 9752c4260..ed2952e48 100644
--- a/src/server/authentication/models/User.ts
+++ b/src/server/authentication/models/User.ts
@@ -47,6 +47,8 @@ const userSchema = new mongoose.Schema({
passwordResetToken: String,
passwordResetExpires: Date,
+ workspaces: Array,
+
facebook: String,
twitter: String,
google: String,
diff --git a/views/stylesheets/authentication.css b/views/stylesheets/authentication.css
index d3e1fa20a..232e5a091 100644
--- a/views/stylesheets/authentication.css
+++ b/views/stylesheets/authentication.css
@@ -11,6 +11,9 @@ label {
body {
/* background-color: #ccbbcc; */
background-color: #251f1f;
+ /* background-image: url(https://bit.ly/2XibZvI);
+ background-repeat: no-repeat;
+ background-size: cover; */
}
#logo {