Added Phone Auth and verify email
This commit is contained in:
parent
803a68f3e0
commit
2c624b1040
|
@ -13,11 +13,11 @@ const smtpTransport = require("nodemailer-smtp-transport");
|
||||||
|
|
||||||
var transport = nodemailer.createTransport(
|
var transport = nodemailer.createTransport(
|
||||||
smtpTransport({
|
smtpTransport({
|
||||||
host: "email-smtp.us-east-1.amazonaws.com", //`${process.env.HOST}`
|
host: `${process.env.HOST}`, //`${process.env.HOST}`
|
||||||
port: 465,
|
port: 465,
|
||||||
auth: {
|
auth: {
|
||||||
user: "AKIA2G7743RRTZMVXE3X", //`${process.env.EMAIL}`
|
user: `${process.env.EMAIL}`, //`${process.env.EMAIL}`
|
||||||
pass: "BJSjV3jArJfsnk1LhFc/hUmisEyEtbLNGgrRbv0noh8c", //`${process.env.PASS}`
|
pass: `${process.env.PASS}`, //`${process.env.PASS}`
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -224,157 +224,94 @@ module.exports.forgotpassword = async (req, res, next) => {
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
const reset_link = `${link}/${user._id}/${token}`;
|
const reset_link = `${link}/${user._id}/${token}`;
|
||||||
|
|
||||||
const message = {
|
const message = {
|
||||||
from: `${sending_company_email}`, // Sender address
|
from: `${sending_company_email}`, // Sender address
|
||||||
to: `${user.email}`, // List of recipients
|
to: `${user.email}`, // List of recipients
|
||||||
subject: `${subject}`, // Subject line
|
subject: `${subject}`, // Subject line
|
||||||
html: `<!DOCTYPE html>
|
html: `
|
||||||
<html lang="en">
|
<!doctype html>
|
||||||
<head>
|
<html lang="en-US">
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta
|
|
||||||
name="viewport"
|
|
||||||
content="width=device-width, initial-scale=1.0 shrink-to-fit=no"
|
|
||||||
/>
|
|
||||||
<title>Forgot password</title>
|
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
|
|
||||||
/>
|
|
||||||
<link rel="stylesheet" href="./reset.css" />
|
|
||||||
|
|
||||||
<link
|
<head>
|
||||||
href="https://fonts.googleapis.com/css?family=Poppins"
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
||||||
rel="stylesheet"
|
<title>Reset Password Email Template</title>
|
||||||
/>
|
<meta name="description" content="Reset Password Email Template.">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
<style type="text/css">
|
||||||
<link
|
a:hover {text-decoration: underline !important;}
|
||||||
href="https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: Poppins;
|
|
||||||
letter-spacing: 0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gray-reset-J {
|
|
||||||
background-color: #f2f7fb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset-J h2 {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.reset-J p {
|
|
||||||
font-weight: lighter;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset-J button {
|
|
||||||
background-color: #ffc600;
|
|
||||||
color: white;
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 19px;
|
|
||||||
width: 340px;
|
|
||||||
border-radius: 10px 10px 10px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset-logo-J img {
|
|
||||||
width: 79px;
|
|
||||||
height: 79px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset-logo1-J img {
|
|
||||||
width: 200px;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset-logo2-J img {
|
|
||||||
width: 17px;
|
|
||||||
height: 17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset-light-J p {
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.light-copyright-J {
|
|
||||||
font-weight: lighter;
|
|
||||||
color: #6d6d6d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bold-copyright-J {
|
|
||||||
font-weight: 700;
|
|
||||||
color: #6d6d6d;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 410px) {
|
|
||||||
.reset-J button {
|
|
||||||
width: 240px;
|
|
||||||
background-color: #ffc600;
|
|
||||||
color: white;
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 19px;
|
|
||||||
border-radius: 10px 10px 10px 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
<div class="container justify-content-center">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div
|
|
||||||
class="
|
|
||||||
m-5
|
|
||||||
px-5
|
|
||||||
py-4
|
|
||||||
gray-reset-J
|
|
||||||
col-xl-6 col-lg-6 col-md-8 col-sm-11 col-12
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<div class="my-3 reset-logo-J">
|
|
||||||
<img src="./images/certificate design-11.png" alt="" />
|
|
||||||
</div>
|
|
||||||
<div class="reset-J">
|
|
||||||
<div class="my-4">
|
|
||||||
<h2 style="text-align: center">Hello</h2>
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
We got a request to reset your Password. No need to worry you can
|
|
||||||
reset your Password by clicking the Reset Button.
|
|
||||||
</p>
|
|
||||||
<a href=${reset_link}> <button class="btn p-3 my-3">Reset Password</button></a>
|
|
||||||
|
|
||||||
<div class="my-3">
|
<body marginheight="0" topmargin="0" marginwidth="0" style="margin: 0px; background-color: #f2f3f8;" leftmargin="0">
|
||||||
<p>
|
<!--100% body table-->
|
||||||
Facing any other issue write us at
|
<table cellspacing="0" border="0" cellpadding="0" width="100%" bgcolor="#f2f3f8"
|
||||||
<a href="#">info@cantileverlabs.com</a>
|
style="@import url(https://fonts.googleapis.com/css?family=Rubik:300,400,500,700|Open+Sans:300,400,600,700); font-family: 'Open Sans', sans-serif;">
|
||||||
</p>
|
<tr>
|
||||||
</div>
|
<td>
|
||||||
|
<table style="background-color: #f2f3f8; max-width:670px; margin:0 auto;" width="100%" border="0"
|
||||||
|
align="center" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td style="height:80px;"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center;">
|
||||||
|
<a href="https://cantileverlabs.com" title="logo" target="_blank">
|
||||||
|
<img width="80" height="80"
|
||||||
|
src="https://media-exp1.licdn.com/dms/image/C510BAQEgcV3sgE1PIA/company-logo_200_200/0/1552289011007?e=2159024400&v=beta&t=FO8loLVwC5qoHmYkk-gR-mv7vC36LPG17yZkxOFl6Go" title="logo" alt="logo">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="height:20px;"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"
|
||||||
|
style="max-width:670px;background:#fff; border-radius:3px; text-align:center;-webkit-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);-moz-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);box-shadow:0 6px 18px 0 rgba(0,0,0,.06);">
|
||||||
|
<tr>
|
||||||
|
<td style="height:40px;"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding:0 35px;">
|
||||||
|
<h1 style="color:#1e1e2d; font-weight:500; margin:0;font-size:32px;font-family:'Rubik',sans-serif;">You have
|
||||||
|
requested to reset your password</h1>
|
||||||
|
<span
|
||||||
|
style="display:inline-block; vertical-align:middle; margin:29px 0 26px; border-bottom:1px solid #cecece; width:100px;"></span>
|
||||||
|
<p style="color:#455056; font-size:15px;line-height:24px; margin:0;">
|
||||||
|
We cannot simply send you your old password. A unique link to reset your
|
||||||
|
password has been generated for you. To reset your password, click the
|
||||||
|
following link and follow the instructions.
|
||||||
|
</p>
|
||||||
|
<a href=${reset_link}
|
||||||
|
style="background:#F9F871;text-decoration:none !important; font-weight:500; margin-top:35px; color:#111;text-transform:uppercase; font-size:14px;padding:10px 24px;display:inline-block;border-radius:50px;">Reset
|
||||||
|
Password</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="height:40px;"> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<tr>
|
||||||
|
<td style="height:20px;"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center;">
|
||||||
|
<div class="reset-logo2-J ">
|
||||||
|
<img src="./images/Icon material-copyright.png" alt="">
|
||||||
|
<span class="light-copyright-J">copyright <span class="bold-copyright-J">2018 Cantilever Labs</span></span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="height:80px;"> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<!--/100% body table-->
|
||||||
|
</body>
|
||||||
|
|
||||||
<div class="my-4 reset-logo1-J">
|
|
||||||
<img src="./images/Rectangle 1048.png" alt="" />
|
|
||||||
</div>
|
|
||||||
<div class="reset-light-J">
|
|
||||||
<p>Privacy Policy | Terms of Use | Contact us</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="reset-logo2-J my-5">
|
|
||||||
<img src="./images/Icon material-copyright.png" alt="" />
|
|
||||||
<span class="light-copyright-J"
|
|
||||||
>copyright
|
|
||||||
<span class="bold-copyright-J">2018 Cantilever Labs</span></span
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
|
|
||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
`, // design html for email message.
|
`, // design html for email message.
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,6 +13,7 @@
|
||||||
"aws-sdk": "^2.907.0",
|
"aws-sdk": "^2.907.0",
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
|
"bootstrap-email": "^1.1.1",
|
||||||
"cookie-session": "^1.4.0",
|
"cookie-session": "^1.4.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"crypto": "^1.0.1",
|
"crypto": "^1.0.1",
|
||||||
|
@ -24,7 +25,6 @@
|
||||||
"messagebird": "^3.6.1",
|
"messagebird": "^3.6.1",
|
||||||
"mongoose": "^5.12.2",
|
"mongoose": "^5.12.2",
|
||||||
"nodemailer": "^6.6.0",
|
"nodemailer": "^6.6.0",
|
||||||
"nodemailer-express-handlebars": "^4.0.0",
|
|
||||||
"nodemailer-smtp-transport": "^2.7.4",
|
"nodemailer-smtp-transport": "^2.7.4",
|
||||||
"passport": "^0.4.1",
|
"passport": "^0.4.1",
|
||||||
"passport-google-oauth": "^2.0.0",
|
"passport-google-oauth": "^2.0.0",
|
||||||
|
|
Loading…
Reference in New Issue