codestates / codestates/Bobpago
[๐จErr Handling] ์ด๋ฉ์ผ ์ธ์ฆ ์ค๋ฅ ๋ฐ ๊ฐ์
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
### ์ด๋ค ์๋ฌ์ธ๊ฐ์?
- ์ผ๋ฐ ํ์(์ด๋ฉ์ผ ํ์ ๊ฐ์
) ๋ก๊ทธ์ธ์ ๋น๋ฐ๋ฒํธ๋ฅผ ํ์ธํ์ง ์๊ณ , ์์ด๋๋ง ๋น๊ตํด์ ๋ก๊ทธ์ธ ์น์ธํ์
Pull Request ๐๐ป [PR1](https://github.com/codestates/Bobpago/pull/178) , [PR2](https://github.com/codestates/Bobpago/pull/179)
### ์๋ฌ ํธ๋ค๋ง ๋ฐฉ๋ฒ
- ๋น๋ฐ๋ฒํธ์ ๊ฐ์ด ์ธ์ฆ์ ํ ์ ์๊ฒ ๋ณ๊ฒฝํ์
- bcrypt ๋ฅผ ์ ์ฉํด์ ๋น๋ฐ๋ฒํธ ์ํธํ ๋ณตํธํ ์์
ํจ
- ๊ธฐ์กด ํ์๊ฐ์
์ ์ ์ ์ ๊ท ์ด๋ฉ์ผ ํ์๊ฐ์
์ ์ ๋ก์ง์ ๋๋ ์ ์ธ์ฆ์ฒ๋ฆฌ ํ์
```js
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) {
// ๋ก๊ทธ์ธ ์ฒ๋ฆฌ
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.