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
b60b2c84
Commit
b60b2c84
authored
5 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
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
Showing
1 changed file
routes/routes.js
+27
-5
routes/routes.js
with
27 additions
and
5 deletions
+27
-5
routes/routes.js
+
27
-
5
View file @
b60b2c84
...
@@ -149,7 +149,7 @@ module.exports = function (app, config, passport) {
...
@@ -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) {
...
@@ -449,9 +449,27 @@ module.exports = function (app, config, passport) {
res
.
redirect
(
'
/account/login
'
)
res
.
redirect
(
'
/account/login
'
)
});
});
app
.
get
(
'
/logout
'
,
function
(
req
,
res
)
{
// todo: user registration with captcha
if
(
req
.
user
==
null
)
{
app
.
get
(
'
/registration
'
,
function
(
req
,
res
)
{
return
res
.
redirect
(
'
/account/
'
);
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
// encrypt password
bcrypt
.
genSalt
(
saltRounds
,
function
(
err
,
salt
)
{
bcrypt
.
genSalt
(
saltRounds
,
function
(
err
,
salt
)
{
...
@@ -468,12 +486,16 @@ module.exports = function (app, config, passport) {
...
@@ -468,12 +486,16 @@ module.exports = function (app, config, passport) {
else
{
else
{
req
.
flash
(
'
success
'
,
'
Your account has been created. Please log in.
'
);
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
)
{
app
.
get
(
'
/email/:email
'
,
function
(
req
,
res
)
{
methods
.
checkUserEmail
(
req
.
params
.
email
,
function
(
err
,
user
){
methods
.
checkUserEmail
(
req
.
params
.
email
,
function
(
err
,
user
){
if
(
!
err
)
{
if
(
!
err
)
{
...
...
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