Commit 231c1f60 authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

changed redirect paths relative to account

parent 00fe9e79
Pipeline #349 passed with stage
in 9 seconds
......@@ -70,19 +70,19 @@ module.exports = function (app, config, passport) {
app.get('/login',
passport.authenticate(config.passport.strategy,
{
successRedirect: '/account',
failureRedirect: '/login'
successRedirect: '/account/',
failureRedirect: '/account/login'
})
);
app.post(config.passport.saml.path,
passport.authenticate(config.passport.strategy,
{
failureRedirect: '/',
failureRedirect: '/account/',
failureFlash: true
}),
function (req, res) {
res.redirect('/');
res.redirect('/account/');
}
);
......@@ -92,7 +92,7 @@ module.exports = function (app, config, passport) {
user: req.user // useful for view engine, useless for HTML
});
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
......@@ -156,7 +156,7 @@ module.exports = function (app, config, passport) {
}
])
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
......@@ -166,7 +166,7 @@ module.exports = function (app, config, passport) {
user: req.user // useful for view engine, useless for HTML
});
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
......@@ -191,11 +191,11 @@ module.exports = function (app, config, passport) {
else {
req.flash('success', 'Profile updated!');
}
res.redirect('/profile');
res.redirect('/account/profile');
})
}
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
......@@ -210,7 +210,7 @@ module.exports = function (app, config, passport) {
// Load hashed passwd from DB.
dbconn.user.query('SELECT password FROM user WHERE email="'+req.user.email+'"', function (err, rows, fields) {
if (err) {
res.redirect('/500')
res.redirect('/account/500')
throw err
}
var userPwd = rows[0].password
......@@ -218,16 +218,16 @@ module.exports = function (app, config, passport) {
// check if the password is correct
bcrypt.compare(currPwd, userPwd, function(err, isMatch) {
if (err) {
res.redirect('/500')
res.redirect('/account/500')
throw err
}
else if (!isMatch) {
req.flash('error', "Sorry, your password was incorrect. Please double-check your password.")
res.redirect('/security')
res.redirect('/account/security')
} else {
if ( newPwd != retypePwd ) {
req.flash('error', "Passwords do no match. Please make sure you re-type your new password correctly.")
res.redirect('/security')
res.redirect('/account/security')
}
else {
// update password
......@@ -242,7 +242,7 @@ module.exports = function (app, config, passport) {
req.flash('success', "Pasword updated!")
console.log('pasword updated!')
}
res.redirect('/security')
res.redirect('/account/security')
})
});
});
......@@ -251,7 +251,7 @@ module.exports = function (app, config, passport) {
})
})
} else {
res.redirect('/login');
res.redirect('/account/login');
}
});
......@@ -345,7 +345,7 @@ module.exports = function (app, config, passport) {
else {
req.flash('success', 'An e-mail has been sent to ' + emailAddress + ' with further instructions.');
}
res.redirect('/forgotPwd');
res.redirect('/account/forgotPwd');
});
});
......@@ -354,7 +354,7 @@ module.exports = function (app, config, passport) {
//console.log(user);
if (!user) {
req.flash('error', 'Password reset token is invalid or has expired.');
res.redirect('/forgotPwd');
res.redirect('/account/forgotPwd');
}
else {
res.render('reset');
......@@ -387,12 +387,12 @@ module.exports = function (app, config, passport) {
}
});
res.redirect('/login')
res.redirect('/account/login')
});
app.get('/logout', function (req, res) {
if (req.user == null) {
return res.redirect('/');
return res.redirect('/account/');
}
req.user.nameID = req.user.id;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment