Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
bd2881c2
Commit
bd2881c2
authored
5 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
reverted to dedicated account url
parent
3acdd9fe
master
MLAB-677
devel
devel_wolfgang
patch-1
reset-jul13
reset-merge
test_logoutbutton
testing
1 merge request
!2
Mlab 56
Pipeline
#523
passed with stage
in 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routes/routes.js
+24
-24
routes/routes.js
with
24 additions
and
24 deletions
+24
-24
routes/routes.js
+
24
-
24
View file @
bd2881c2
...
@@ -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
'
);
}
}
})
})
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets