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
In nest.js project
import bcrypt from 'bcryptjs'; export class AuthService { // ..... private async validateUser(dto: SignInDto): Promise<User | null> { console.log('------------->'); console.dir(bcrypt); // compare password const isValidPassword = await bcrypt.compare(dto.data.password, user.password); if (!isValidPassword) return null; return user; } }
In console
-------------> undefined POST /api/auth/login 500 in 21ms [Nest] 1938 - 02/25/2025, 5:16:48 AM ERROR [ExceptionsHandler] TypeError: Cannot read properties of undefined (reading 'compare') at AuthService.validateUser (/usr/src/app/src/auth/auth.service.ts:133:42)
What could be the issue?
The text was updated successfully, but these errors were encountered:
I've got the same issue
Package version: 3.0.2
Sorry, something went wrong.
You can just import the functions one by one so: import { compareSync, hash, hashSync, ... } from 'bcryptjs';
import { compareSync, hash, hashSync, ... } from 'bcryptjs';
No branches or pull requests
In nest.js project
In console
What could be the issue?
The text was updated successfully, but these errors were encountered: