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

fix forgot password

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