diff --git a/public/js/security.js b/public/js/security.js index 52b42f148943c5e1671d4141bcd3097523196132..0f4a8f09f61f75a51046454a85e4d31250af12af 100644 --- a/public/js/security.js +++ b/public/js/security.js @@ -1,4 +1,5 @@ // check password and password confirmation input fields +// used in Security and Reset Password $('#inputNewPwd, #inputConfirm').on('keyup', function () { var isBest, isMatch; diff --git a/routes/routes.js b/routes/routes.js index 7077fc1d8155c938f62feb12f8089972247df1fa..51ce386fb1519efafe5ad8a86ad94ea799536a5e 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -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 diff --git a/views/reset.pug b/views/reset.pug index 774f921526fc022ef093c2d43f3488cc928d9414..c0e9d85b2f69060e8f4773a3a8b75eee41822d46 100644 --- a/views/reset.pug +++ b/views/reset.pug @@ -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