codestates / Bobpago

์žฌ๋ฃŒ๋งŒ ์•Œ๋ ค์ค˜, ๋ฐฅํŒŒ๊ณ ๊ฐ€ ํ•ด๊ฒฐํ•ด์ค„๊ป˜ ๐Ÿค–
https://www.bobpago.com
5 stars 3 forks source link

[๐ŸšจErr Handling] ์ด๋ฉ”์ผ ์ธ์ฆ ์˜ค๋ฅ˜ ๋ฐ ๊ฐœ์„  #180

Open tjdgns5272 opened 3 years ago

tjdgns5272 commented 3 years ago

์–ด๋–ค ์—๋Ÿฌ์ธ๊ฐ€์š”?

์—๋Ÿฌ ํ•ธ๋“ค๋ง ๋ฐฉ๋ฒ•

    const { email, password } = checkSignInDto;

    const user = await this.usersRepository.findOne({ email });
    const oldUser = await this.usersRepository.findOne({ email, password });

    const checkPassword = await bcrypt.compare(password, user.password);
    if (checkPassword || oldUser) {
            // ๋กœ๊ทธ์ธ ์ฒ˜๋ฆฌ
    }