Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixing promise and callback #58

Open
LinaYahya opened this issue Aug 29, 2021 · 0 comments
Open

Mixing promise and callback #58

LinaYahya opened this issue Aug 29, 2021 · 0 comments
Labels
enhancement New feature or request review

Comments

@LinaYahya
Copy link

bcrypt.compare(password, dataInf.password).then((data) => {
jwt.sign({ id: dataInf.id, email: dataInf.email, username: dataInf.username },
process.env.SECRET, (err, token) => {

While we are working with promise here, It's a good practice to convert jwt.sign to promise then working with it.

@LinaYahya LinaYahya added enhancement New feature or request review labels Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request review
Projects
None yet
Development

No branches or pull requests

1 participant