Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- nestjs
- Python
- 공룡게임
- Queue
- game
- dfs
- jest
- OCR
- Express
- typeORM
- cookie
- class
- GIT
- MySQL
- 게임
- 자료구조
- MongoDB
- Nest.js
- flask
- react
- TypeScript
- nodejs
- AWS
- Dinosaur
- Sequelize
- mongoose
- Bull
- JavaScript
- 정렬
Archives
- Today
- Total
목록@BeforeInsert (1)
포시코딩
[TypeORM] BeforeInsert() - Encrypting Passwords in Entity
지금까지는 회원가입 과정에서의 서비스 단에서 비밀번호를 암호화해왔다. 기존 코드 auth.service.ts import * as bcrypt from 'bcrypt'; @Injectable() export class AuthService { async signupBuyer(body: signupBuyerDTO) { const { password } = body; const passwordHash = await this.hashPassword(password); body.passwordHash = passwordHash; // 회원가입 로직 } private async hashPassword(password: string) { return bcrypt.hashSync(password, 10); } } 하..
Node.js
2023. 12. 21. 09:21