-
Notifications
You must be signed in to change notification settings - Fork 3
oauth 구현체 구현 (kakao, naver) #24
New issue
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
The head ref may contain hidden characters: "10-be-oauth-\uAD6C\uD604\uCCB4-\uAD6C\uD604"
Conversation
google의 authorization code 반환 방식이 조금 달라서 kakao로 교체
.git이 root 폴더에 있어서 front에서 commit을 해도 back의 test를 거쳐야 하는 등 문제가 있어서 제거 했습니다
seyoung8239
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
백앤드 하나도 모르는 물음표 살인마 등판했습니다.. 고생하셨습니다!
| "moduleNameMapper": { | ||
| "@config": "<rootDir>/config/index", | ||
| "@constant": "<rootDir>/constant/index", | ||
| "@types": "<rootDir>/types/index", | ||
| "^src/(.*)$": "<rootDir>/$1" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요건 어떤 역할 하는건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이게 nest 시작은 빌드된 형태로 시작돼서 ts에서 alias 설정을 하면 빌드도 alias대로 바뀌는데, jest는 ts 상태에서 바로 해버려서 ts alias로 된 @types 같은 것을 못 읽어서 해당 alias가 실제로 어떤 경로인지 jest에 mapping하는 겁니다.
| "build": "nest build && tsc-alias", | ||
| "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빌드 환경을 따로 구축하기 위해서 tsx-alias를 지정해주는 건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빌드 때 d.ts.파일에 alias도 동일하게 되는데 저걸 돌리면 alias도 원래 경로로 돌아옵니다
| @@ -0,0 +1 @@ | |||
| export type MockRepository<T = any> = Partial<Record<keyof T, jest.Mock>>; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
유틸리티 타입 굿입니다.
| // OAUTH | ||
| export enum OAUTH_TYPE { | ||
| NAVER = 'naver', | ||
| GOOGLE = 'google', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구글은 왜 빼셨나요ㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"노션에 발생한 문제"에서 보시면 원인이 있는데 그게 구글 문제인 줄 알고 kakao로 바꿨다가 나중에 원인을 파악해서 그냥 kakao로 갑니다
| // const user = await this.authService.socialStart({ type, authorizationCode }); | ||
| const user = await this.authService.socialStart({ type, authorizationCode }); | ||
| const accessToken = this.authService.createJwt({ | ||
| payload: { nickname: 'user.nickname', email: 'user.email' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트한다고 문자열 처리된 부분 다시 변수로 만들어주시면 됩니다~
관련 이슈
작업 내용
OAuth 인터페이스를 기반으로 한 OAuth 구현체 구현
OAuth 테스트 코드 작성