mirror of
https://gitlab.com/nekoya/web.git
synced 2024-12-22 14:35:01 +01:00
Update forgot password
This commit is contained in:
parent
9831193fe6
commit
439a9e289d
7 changed files with 56 additions and 23 deletions
|
@ -161,18 +161,51 @@ router.route("/checkout")
|
|||
});
|
||||
});
|
||||
|
||||
router.get("/forgot-password", (_req, res) => {
|
||||
res.render("pages/forgot-password");
|
||||
});
|
||||
|
||||
router.route("/reset-password")
|
||||
.get((req, res) => {
|
||||
if (!req.query.token) {
|
||||
res.redirect("/");
|
||||
} else {
|
||||
res.render("pages/reset-password", {
|
||||
token: req.query.token
|
||||
})
|
||||
}
|
||||
})
|
||||
.post((req, res) => {
|
||||
controller.reset_password(req.query.token, req.body.password).then((data) => {
|
||||
if (data[0] == 200) {
|
||||
res.render("pages/register-verification-completed");
|
||||
} else {
|
||||
res.redirect("/");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.route("/forgot-password")
|
||||
.get((req, res) => {
|
||||
auth.session_converter(req.cookies.session_token).then((key) => {
|
||||
if (key != null) {
|
||||
res.redirect("/");
|
||||
} else {
|
||||
res.render("pages/forgot-password");
|
||||
}
|
||||
});
|
||||
})
|
||||
.post((req, res) => {
|
||||
controller.request_reset_password(req.body.email).then((data) => {
|
||||
if (data[0] == 200) {
|
||||
res.render("pages/register-verification-sent");
|
||||
} else {
|
||||
res.redirect("/forgot-password");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/otp", (_req, res) => {
|
||||
res.render("pages/otp");
|
||||
});
|
||||
|
||||
router.get("/change-password", (_req, res) => {
|
||||
res.render("pages/change-password");
|
||||
});
|
||||
|
||||
router.get("/products", (req, res) => {
|
||||
auth.session_converter(req.cookies.session_token).then((key) => {
|
||||
if (key != null) {
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
<script type="text/javascript" src="/js/payment.js"></script>
|
||||
<% } else if(state == "login") { %>
|
||||
<script type="text/javascript" src="/js/login.js"></script>
|
||||
<% } else if(state == "change-password") { %>
|
||||
<script type="text/javascript" src="/js/change-password.js"></script>
|
||||
<% } else if(state == "reset-password") { %>
|
||||
<script type="text/javascript" src="/js/reset-password.js"></script>
|
||||
<% } else if(state == "register") { %>
|
||||
<script type="text/javascript" src="/js/register.js"></script>
|
||||
<% } else if(state == "otp") { %>
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
<link href="/css/register-verification-sent.css" rel="stylesheet">
|
||||
<% } else if(state == "forgot-password") { %>
|
||||
<link href="/css/forgot-password.css" rel="stylesheet">
|
||||
<% } else if(state == "change-password") { %>
|
||||
<link href="/css/change-password.css" rel="stylesheet">
|
||||
<% } else if(state == "reset-password") { %>
|
||||
<link href="/css/reset-password.css" rel="stylesheet">
|
||||
<% } else if(state == "otp") { %>
|
||||
<link href="/css/otp.css" rel="stylesheet">
|
||||
<% } else if(state == "faq") { %>
|
||||
|
|
|
@ -17,15 +17,15 @@
|
|||
<a>Enter your email to receive a link to reset your password.</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="px-4 py-3">
|
||||
<form class="px-4 py-3" action="forgot-password" method="POST">
|
||||
<div class="form-group" style="text-align: left;">
|
||||
<a data-feather="mail" href="" style="font-size: 40px;"></a>
|
||||
<label for="exampleDropdownFormEmail1">Email</label>
|
||||
<input class="form-control input-sm text-center" id="exampleDropdownFormEmail1"
|
||||
placeholder="Email address" type="email">
|
||||
<input class="form-control input-sm text-center"
|
||||
placeholder="Email address" type="email" id="email" name="email">
|
||||
</div>
|
||||
<a href="otp"><input class="btn btn-resetpassword btn-primary" style="width: 100%;"
|
||||
type="button" value="Reset Password"></a>
|
||||
<input class="btn btn-resetpassword btn-primary" style="width: 100%;"
|
||||
type="submit" value="Reset Password">
|
||||
<br><br>
|
||||
<div class="hoverforgot-1 text-center">
|
||||
<a href="login">Or Return to Login</a>
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<%- include('../layouts/header.ejs', {title: 'Change Password', state: 'change-password'}); %>
|
||||
<%- include('../layouts/header.ejs', {title: 'Reset Password', state: 'reset-password'}); %>
|
||||
|
||||
<body>
|
||||
<%- include('../layouts/navbar.ejs', {types: 'v2', title: 'Change Password'}); %>
|
||||
<%- include('../layouts/navbar.ejs', {types: 'v2', title: 'Reset Password'}); %>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card text-white col-md-8 col-lg-6 col-xl-5">
|
||||
<h1 class="card-header text-white">Change Password</h1>
|
||||
<h1 class="card-header text-white">Reset Password</h1>
|
||||
<lottie-player autoplay background="transparent" class="icon" loop speed="5" style="height: 300px;"
|
||||
src="https://assets9.lottiefiles.com/packages/lf20_rlhnbbev.json"></lottie-player>
|
||||
<div class="py-3 text" style="padding: 0% 5%; text-align: center;">
|
||||
<a>Please Enter a new password to change the current one.</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="px-4 py-3">
|
||||
<form class="px-4 py-3" action="reset-password?token=<%= token %>" method="POST">
|
||||
<div class="form-group" style="text-align: left;">
|
||||
<a data-feather="key" href="" style="font-size: 40px;"></a>
|
||||
<label for="password">New Password</label>
|
||||
|
@ -44,8 +44,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="login"><input class="btn btn-resetpassword btn-primary" style="width: 100%;"
|
||||
type="button" value="Reset Password"></a>
|
||||
<a><input class="btn btn-resetpassword btn-primary" style="width: 100%;"
|
||||
type="submit" value="Reset Password"></a>
|
||||
<br><br>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -55,7 +55,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<%- include('../layouts/footer.ejs', {state: 'change-password'}); %>
|
||||
<%- include('../layouts/footer.ejs', {state: 'reset-password'}); %>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue