-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from LocalMingle/dev
[dev -> main] 희용, 에릭 작업 내용 merge
- Loading branch information
Showing
17 changed files
with
224 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,46 @@ | ||
// import { PassportStrategy } from '@nestjs/passport'; | ||
// import { Strategy } from 'passport-jwt'; | ||
// import { Strategy, ExtractJwt } from 'passport-jwt'; | ||
// import { Injectable, UnauthorizedException, Request } from '@nestjs/common'; | ||
// import { JwtService } from '@nestjs/jwt'; | ||
// import { UsersService } from '../../users/users.service'; | ||
|
||
// @Injectable() | ||
// export class JwtRefreshStrategy extends PassportStrategy(Strategy, 'refresh') { | ||
// constructor() { | ||
// constructor( | ||
// private jwtService: JwtService, | ||
// private usersService: UsersService | ||
// ) { | ||
// super({ | ||
// jwtFromRequest: (req) => { | ||
// const cookie = req.headers.cookie; | ||
// const refreshToken = cookie.replace('refreshToken=', ''); | ||
// return refreshToken; | ||
// }, | ||
// jwtFromRequest: ExtractJwt.fromHeader('refreshtoken'), // 헤더에서 리프레시 토큰을 추출 | ||
// secretOrKey: process.env.JWT_REFRESH_KEY, | ||
// }); | ||
// } | ||
|
||
// validate(payload) { | ||
// return { | ||
// email: payload.email, | ||
// id: payload.sub, | ||
// }; | ||
// async validate(payload: any, @Request() req: any) { | ||
// // 'refreshtoken' 헤더에서 refreshToken을 추출 | ||
// const refreshToken = req.headers.refreshtoken as string; | ||
// console.log('리프레시토큰 확인', refreshToken); | ||
// if (!refreshToken) { | ||
// throw new UnauthorizedException('Refresh token not provided'); | ||
// } | ||
|
||
// try { | ||
// // 리프레시 토큰의 유효성을 검증 | ||
// const decodedToken = this.jwtService.verify(refreshToken, { | ||
// secret: process.env.JWT_REFRESH_KEY, | ||
// }); | ||
|
||
// // 유효한 사용자를 찾을 때 사용자 서비스를 활용 | ||
// const user = await this.usersService.findById(decodedToken.sub); | ||
|
||
// if (!user) { | ||
// throw new UnauthorizedException('Invalid token'); | ||
// } | ||
|
||
// // 사용자 정보를 반환 | ||
// return { email: user.email, id: user.userId }; | ||
// } catch (error) { | ||
// throw new UnauthorizedException('Invalid token'); | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ export class EventsService { | |
}, | ||
}); | ||
|
||
|
||
|
||
return event; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { IsInt } from 'class-validator'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class VerifyCodeDto { | ||
@ApiProperty() | ||
@IsInt() | ||
@ApiProperty({ | ||
description: 'code', | ||
example: '12345', | ||
}) | ||
code: number; | ||
} |
Oops, something went wrong.