Changed Views to accept CSRF token
parent
f9ec861151
commit
c99c8fe1f8
2
app.js
2
app.js
|
@ -79,7 +79,7 @@ app.use(passport.initialize());
|
|||
app.use(passport.session());
|
||||
app.use(function(req, res, next) {
|
||||
res.locals.user = req.user;
|
||||
res.locals.token = req.csrfToken();
|
||||
res.locals.token = req.csrfToken();
|
||||
next();
|
||||
});
|
||||
app.use(flash());
|
||||
|
|
|
@ -25,7 +25,7 @@ block content
|
|||
label.control-label(for='username') Password
|
||||
input.form-control(type='password', name='password', id='password', placeholder='Password')
|
||||
.form-group
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
.form-group
|
||||
button.btn.btn-primary(type='submit')
|
||||
i.fa.fa-unlock-alt
|
||||
|
|
|
@ -31,7 +31,7 @@ block content
|
|||
.col-xs-4
|
||||
input.form-control(type='text', name='website', id='website', value='#{user.profile.website}')
|
||||
.form-group
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
.form-group
|
||||
.col-xs-offset-2.col-xs-4
|
||||
button.btn.btn.btn-primary(type='submit') Update Profile
|
||||
|
@ -52,7 +52,7 @@ block content
|
|||
.col-xs-4
|
||||
input.form-control(type='password', name='confirmPassword', id='confirmPassword')
|
||||
.form-group
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
.form-group
|
||||
.col-xs-offset-3.col-xs-4
|
||||
button.btn.btn.btn-primary(type='submit') Change Password
|
||||
|
@ -85,4 +85,4 @@ block content
|
|||
if user.github
|
||||
p: a.text-danger(href='/account/unlink/github') Unlink your GitHub account
|
||||
else
|
||||
p: a(href='/auth/github') Link your GitHub account
|
||||
p: a(href='/auth/github') Link your GitHub account
|
|
@ -16,7 +16,7 @@ block content
|
|||
.col-sm-7
|
||||
input.form-control(type='password', name='confirmPassword', id='confirmPassword', placeholder='Confirm Password')
|
||||
.form-group
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
.form-group
|
||||
.col-sm-offset-3.col-sm-7
|
||||
button.btn.btn-success(type='submit')
|
||||
|
|
|
@ -18,7 +18,7 @@ block content
|
|||
.col-sm-8
|
||||
textarea.form-control(type='text', name='message', id='message', rows='7')
|
||||
.form-group
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
input.form-control(type='hidden', name='_csrf', value=token)
|
||||
.form-group
|
||||
.col-sm-offset-2.col-sm-8
|
||||
button.btn.btn-default(type='submit')
|
||||
|
|
Loading…
Reference in New Issue