Commit bafa2004 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

fix forgot password

parent 393920ba
// check password and password confirmation input fields // check password and password confirmation input fields
// used in Security and Reset Password
$('#inputNewPwd, #inputConfirm').on('keyup', function () { $('#inputNewPwd, #inputConfirm').on('keyup', function () {
var isBest, isMatch; var isBest, isMatch;
......
...@@ -411,6 +411,7 @@ module.exports = function (app, config, passport) { ...@@ -411,6 +411,7 @@ module.exports = function (app, config, passport) {
else { else {
req.flash('success', "Your pasword has been updated.") req.flash('success', "Your pasword has been updated.")
console.log('pasword updated!') console.log('pasword updated!')
res.redirect('/login')
// todo: send confirmation email // todo: send confirmation email
} }
}) })
...@@ -419,10 +420,11 @@ module.exports = function (app, config, passport) { ...@@ -419,10 +420,11 @@ module.exports = function (app, config, passport) {
} }
else { else {
req.flash('error', "User not found.") req.flash('error', "User not found.")
res.redirect('/login')
} }
}); });
res.redirect('/login') //res.redirect('/login')
}); });
// todo: user registration with captcha // todo: user registration with captcha
......
...@@ -5,6 +5,7 @@ html(lang="en") ...@@ -5,6 +5,7 @@ html(lang="en")
meta(charset="UTF-8") meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no")
link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/bootstrap/bootstrap.css") link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/bootstrap/bootstrap.css")
link(rel="stylesheet", type="text/css", href="https://transfer.hft-stuttgart.de/css/custom/login.css")
link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous") link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
style. style.
.collapse { .collapse {
...@@ -30,8 +31,7 @@ html(lang="en") ...@@ -30,8 +31,7 @@ html(lang="en")
body body
div(class="container-fluid") div(class="container-fluid")
div(class="row") div(class="row")
div(class="col-sm-9") div(class="col-md-6 offset-md-3")
h2 Reset Password
if successes if successes
for success in successes for success in successes
div.alert.alert-success.alert-dismissible #{ success } div.alert.alert-success.alert-dismissible #{ success }
...@@ -40,15 +40,14 @@ html(lang="en") ...@@ -40,15 +40,14 @@ html(lang="en")
for error, i in errors for error, i in errors
div.alert.alert-danger.alert-dismissible.fade.show #{ error } div.alert.alert-danger.alert-dismissible.fade.show #{ error }
a(class="close", href="#", data-dismiss="alert", aria-label="close") × a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
form#forgotForm(method="POST") form#forgotForm(method="POST", class="form-signin")
div(class="form-group row") img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192")
label(for="newPwd") New Password div(class="form-row")
input#inputNewPwd(name="inputNewPwd", type="password", class="form-control", placeholder="New Password" required) input#inputNewPwd(name="inputNewPwd", type="password", class="form-control", placeholder="New Password" required)
span#recommendation span#recommendation(class='warning')
label(for="confirmPwd") Confirm Password
input#inputConfirm(name="inputConfirm", type="password", class="form-control", placeholder="Confirm Password" required) input#inputConfirm(name="inputConfirm", type="password", class="form-control", placeholder="Confirm Password" required)
span#message span#message(class='warning')
input#updateBtn(type="submit", class="btn btn-primary", value="Update Password" disabled) input#updateBtn(type="submit", class="btn btn-outline-dark btn-block", value="Update Password" disabled)
// jQuery // jQuery
script(src="https://code.jquery.com/jquery-3.3.1.min.js") script(src="https://code.jquery.com/jquery-3.3.1.min.js")
...@@ -56,6 +55,6 @@ html(lang="en") ...@@ -56,6 +55,6 @@ html(lang="en")
// Bootstrap // Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// M4_LAB // M4_LAB
script(src="/js/account.js") script(src="/js/security.js")
script(src="/js/generalFunction.js") script(src="/js/generalFunction.js")
script(src="https://transfer.hft-stuttgart.de/js/headfoot.js") script(src="https://transfer.hft-stuttgart.de/js/headfoot.js")
\ No newline at end of file
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