Commit bd2881c2 authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

reverted to dedicated account url

parent 3acdd9fe
Pipeline #523 passed with stage
in 7 seconds
...@@ -62,7 +62,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -62,7 +62,7 @@ module.exports = function (app, config, passport, i18n) {
failureFlash: true failureFlash: true
}), }),
function (req, res) { function (req, res) {
res.redirect('/'); res.redirect('/account/');
} }
); );
...@@ -125,7 +125,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -125,7 +125,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}) })
} else { } else {
res.redirect('/login'); // localhost res.redirect('/account/login'); // localhost
} }
}); });
...@@ -136,14 +136,14 @@ module.exports = function (app, config, passport, i18n) { ...@@ -136,14 +136,14 @@ module.exports = function (app, config, passport, i18n) {
app.get('/login', app.get('/login',
passport.authenticate(config.passport.strategy, passport.authenticate(config.passport.strategy,
{ {
successRedirect: '/account/', successRedirect: '/',
failureRedirect: '/login' failureRedirect: '/login'
}) })
); );
app.get('/logout', function (req, res) { app.get('/logout', function (req, res) {
if (req.user == null) { if (req.user == null) {
return res.redirect('/'); return res.redirect('/account/');
} }
req.user.nameID = req.user.id; req.user.nameID = req.user.id;
...@@ -174,7 +174,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -174,7 +174,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}) })
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -238,7 +238,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -238,7 +238,7 @@ module.exports = function (app, config, passport, i18n) {
} }
]) ])
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -248,7 +248,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -248,7 +248,7 @@ module.exports = function (app, config, passport, i18n) {
user: req.user // useful for view engine, useless for HTML user: req.user // useful for view engine, useless for HTML
}); });
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -278,7 +278,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -278,7 +278,7 @@ module.exports = function (app, config, passport, i18n) {
}) })
} }
} else { } else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -293,7 +293,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -293,7 +293,7 @@ module.exports = function (app, config, passport, i18n) {
// Load hashed passwd from DB // Load hashed passwd from DB
dbconn.user.query('SELECT password FROM credential WHERE user_id='+userId, function (err, rows, fields) { dbconn.user.query('SELECT password FROM credential WHERE user_id='+userId, function (err, rows, fields) {
if (err) { if (err) {
res.redirect('/500') res.redirect('/account/500')
throw err throw err
} }
var userPwd = rows[0].password var userPwd = rows[0].password
...@@ -301,14 +301,14 @@ module.exports = function (app, config, passport, i18n) { ...@@ -301,14 +301,14 @@ module.exports = function (app, config, passport, i18n) {
// check if the password is correct // check if the password is correct
bcrypt.compare(currPwd, userPwd, function(err, isMatch) { bcrypt.compare(currPwd, userPwd, function(err, isMatch) {
if (err) { if (err) {
res.redirect('/500') res.redirect('/account/500')
throw err throw err
} }
else if (!isMatch) { else if (!isMatch) {
//req.flash('error', "Sorry, your password was incorrect. Please double-check your password.") //req.flash('error', "Sorry, your password was incorrect. Please double-check your password.")
req.flash('error', "Das Passwort ist leider falsch. Bitte überprüfen Sie Ihre Eingabe.") req.flash('error', "Das Passwort ist leider falsch. Bitte überprüfen Sie Ihre Eingabe.")
//res.redirect('/security') //res.redirect('/account/security')
res.redirect('/security') res.redirect('/account/security')
} }
else { else {
if ( newPwd != retypePwd ) { if ( newPwd != retypePwd ) {
...@@ -342,7 +342,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -342,7 +342,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}); });
} }
res.redirect('/security') res.redirect('/account/security')
}) })
}); });
}); });
...@@ -354,7 +354,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -354,7 +354,7 @@ module.exports = function (app, config, passport, i18n) {
}) })
} }
else { else {
res.redirect('/login'); res.redirect('/account/login');
} }
}); });
...@@ -429,8 +429,8 @@ module.exports = function (app, config, passport, i18n) { ...@@ -429,8 +429,8 @@ module.exports = function (app, config, passport, i18n) {
//req.flash('success', 'If your email is registered, an e-mail has been sent to ' + emailAddress + ' with further instructions.'); //req.flash('success', 'If your email is registered, an e-mail has been sent to ' + emailAddress + ' with further instructions.');
req.flash('success', 'Wenn Ihre E-Mail-Adresse registriert ist, wurde eine E-Mail mit dem weiteren Vorgehen an ' + emailAddress + ' versendet.'); req.flash('success', 'Wenn Ihre E-Mail-Adresse registriert ist, wurde eine E-Mail mit dem weiteren Vorgehen an ' + emailAddress + ' versendet.');
} }
//res.redirect('/forgotPwd'); // deployment //res.redirect('/account/forgotPwd'); // deployment
res.redirect('/forgotPwd'); // localhost res.redirect('/account/forgotPwd'); // localhost
}); });
}); });
...@@ -439,8 +439,8 @@ module.exports = function (app, config, passport, i18n) { ...@@ -439,8 +439,8 @@ module.exports = function (app, config, passport, i18n) {
if (!user) { if (!user) {
//req.flash('error', 'Password reset token is invalid or has expired.'); //req.flash('error', 'Password reset token is invalid or has expired.');
req.flash('error', 'Der Schlüssel zum zurücksetzen des Passworts ist ungültig oder abgelaufen.'); req.flash('error', 'Der Schlüssel zum zurücksetzen des Passworts ist ungültig oder abgelaufen.');
//res.redirect('/forgotPwd'); // deployment //res.redirect('/account/forgotPwd'); // deployment
res.redirect('/forgotPwd'); // localhost res.redirect('/account/forgotPwd'); // localhost
} }
else { else {
res.render(lang+'/account/reset'); res.render(lang+'/account/reset');
...@@ -479,7 +479,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -479,7 +479,7 @@ module.exports = function (app, config, passport, i18n) {
} }
}); });
// redirect to login page // redirect to login page
res.redirect('/login') res.redirect('/account/login')
} }
}) })
}); });
...@@ -487,7 +487,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -487,7 +487,7 @@ module.exports = function (app, config, passport, i18n) {
} }
else { else {
req.flash('error', "User not found.") req.flash('error', "User not found.")
res.redirect('/login') res.redirect('/account/login')
} }
}); });
...@@ -533,7 +533,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -533,7 +533,7 @@ module.exports = function (app, config, passport, i18n) {
//req.flash('success', 'Your account has been created. Please log in.') //req.flash('success', 'Your account has been created. Please log in.')
req.flash('success', 'Ihr Benutzerkonto wurde angelegt. Bitte melden Sie sich an.') req.flash('success', 'Ihr Benutzerkonto wurde angelegt. Bitte melden Sie sich an.')
} }
res.redirect('/registration'); res.redirect('/account/registration');
}) })
}); });
}); });
...@@ -640,7 +640,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -640,7 +640,7 @@ module.exports = function (app, config, passport, i18n) {
res.render(lang+'/project/addProjectOverview') res.render(lang+'/project/addProjectOverview')
} }
else { else {
res.redirect('/login') res.redirect('/account/login')
} }
}) })
...@@ -681,11 +681,11 @@ module.exports = function (app, config, passport, i18n) { ...@@ -681,11 +681,11 @@ module.exports = function (app, config, passport, i18n) {
if (err) { if (err) {
//req.flash('error', "Failed") //req.flash('error', "Failed")
req.flash('error', "Fehlgeschlagen") req.flash('error', "Fehlgeschlagen")
res.redirect('/addProjectOverview'); res.redirect('/account/addProjectOverview');
} }
else { else {
req.flash('success', 'Your project has been created.') req.flash('success', 'Your project has been created.')
res.redirect('/project'); res.redirect('/account/project');
} }
}) })
} }
......
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