Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
b60b2c84
Commit
b60b2c84
authored
Dec 11, 2019
by
Wolfgang Knopki
Browse files
routes merge artifacts cleansed
parent
d3d90b15
Pipeline
#372
passed with stage
in 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
routes/routes.js
View file @
b60b2c84
...
...
@@ -149,7 +149,7 @@ module.exports = function (app, config, passport) {
});
}
return
res
.
redirect
(
uri
);
return
res
.
redirect
(
'
/
'
);
});
});
...
...
@@ -449,9 +449,27 @@ module.exports = function (app, config, passport) {
res
.
redirect
(
'
/account/login
'
)
});
app
.
get
(
'
/logout
'
,
function
(
req
,
res
)
{
if
(
req
.
user
==
null
)
{
return
res
.
redirect
(
'
/account/
'
);
// todo: user registration with captcha
app
.
get
(
'
/registration
'
,
function
(
req
,
res
)
{
res
.
render
(
'
registration
'
)
})
app
.
post
(
'
/registration
'
,
function
(
req
,
res
)
{
// TODO:
// create gitlab account?
// send email to activate profile?
// user data
var
curDate
=
new
Date
()
var
userData
=
{
title
:
req
.
body
.
inputTitle
,
firstname
:
req
.
body
.
inputFirstname
,
lastname
:
req
.
body
.
inputLastname
,
email
:
req
.
body
.
inputEmail
,
organisation
:
req
.
body
.
inputOrganisation
,
industry
:
req
.
body
.
inputIndustry
,
speciality
:
req
.
body
.
inputSpeciality
,
createdDate
:
curDate
.
toISOString
().
slice
(
0
,
10
)
}
// encrypt password
bcrypt
.
genSalt
(
saltRounds
,
function
(
err
,
salt
)
{
...
...
@@ -468,12 +486,16 @@ module.exports = function (app, config, passport) {
else
{
req
.
flash
(
'
success
'
,
'
Your account has been created. Please log in.
'
);
}
res
.
redirect
(
'
/
account/
registration
'
);
res
.
redirect
(
'
/registration
'
);
})
});
});
})
app
.
get
(
'
/email/:email
'
,
function
(
req
,
res
)
{
methods
.
checkUserEmail
(
req
.
params
.
email
,
function
(
err
,
user
){
if
(
!
err
)
{
...
...
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