We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug The bug happens when trying to create a new user through the /auth/register/ endpoint.
The error is in /src/auth/auth.service.ts:73:33 userDTO.password = bcryptjs.hashSync(body.password, 10);
userDTO.password = bcryptjs.hashSync(body.password, 10);
Seems that bcryptjs is undefined
To Reproduce Steps to reproduce the behaviour:
Expected behaviour The request should create a new user in the database
Screenshots
Environment (please complete the following information):
Additional context none
The text was updated successfully, but these errors were encountered:
I found a solution for that, just change some lines of code inside src/auth/auth.service.ts:
line 3: import bcryptjs from 'bcryptjs'; becomes import { compareSync, hashSync } from 'bcryptjs';
import bcryptjs from 'bcryptjs';
import { compareSync, hashSync } from 'bcryptjs';
line 46: bcryptjs.compareSync(...); becomes compareSync(...);
bcryptjs.compareSync(...);
compareSync(...);
line 73: bcryptjs.hashSync(...) becomes hashSync(...)
bcryptjs.hashSync(...)
hashSync(...)
Sorry, something went wrong.
Thank you for bringing this up, @lollobene. It appears that the latest version of the library has differences in how their modules are exported.
If you resolve the issue on your side, a PR is highly appreciated. Thank you :)
Yeah I just opened a PR :) @joeygoksu Thank you!
josephgoksu
Successfully merging a pull request may close this issue.
Describe the bug
The bug happens when trying to create a new user through the /auth/register/ endpoint.
The error is in /src/auth/auth.service.ts:73:33
userDTO.password = bcryptjs.hashSync(body.password, 10);
Seems that bcryptjs is undefined
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
The request should create a new user in the database
Screenshots
Environment (please complete the following information):
Additional context
none
The text was updated successfully, but these errors were encountered: