-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
579 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require('dotenv/config'); | ||
|
||
const fee = { | ||
BASICC: process.env.BASICC , | ||
UNLIMITEDC: process.env.UNLIMITEDC , | ||
FAMILYC: process.env.FAMILYC , | ||
TRAVELC: process.env.TRAVELC , | ||
BUSINESSC: process.env.BUSINESSC , | ||
STUDENTC: process.env.STUDENTC , | ||
CHARITYC: process.env.CHARITYC , | ||
EXCLUSIVEC: process.env.EXCLUSIVEC , | ||
REWARDC: process.env.REWARDC , | ||
BUDGETC: process.env.BUDGETC , | ||
}; | ||
|
||
module.exports = fee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import jwt from 'jsonwebtoken'; | ||
import transporter from '../middlewares/transporter'; | ||
import model from '../models'; | ||
const sendMail = require('../services'); | ||
|
||
const forgetPassword = async (req, res) => { | ||
try { | ||
const { email } = req.body; | ||
console.log('email', email); | ||
const result = await model.Users.findOne({ | ||
where: { | ||
email, | ||
}, | ||
}); | ||
if (result.length < 1) { | ||
res.status(400).send({ | ||
message: `Sorry an Account with Email: ${email} doesn't exist`, | ||
}); | ||
} else { | ||
const secret = result.password; | ||
const token = jwt.sign({ result }, secret, { | ||
expiresIn: 3600, // 1 hour | ||
}); | ||
const sendEmail = await sendMail.forgetPassword(email, `${process.env.APP_URL}/reset/${resetLink}`, recieverName); | ||
// const url = `http://localhost:8080/resetPassword/${result.id}-${token}`; | ||
|
||
return sendEmail; | ||
} | ||
} catch (error) { | ||
res.status(500).json(error); | ||
} | ||
}; | ||
|
||
export default forgetPassword; |
Oops, something went wrong.