Feat/20 메일인증확인#131
Merged
exxocism merged 11 commits intocodestates:dev-backfrom Jan 16, 2022
Hidden character warning
The head ref may contain hidden characters: "feat/20-\uba54\uc77c\uc778\uc99d\ud655\uc778"
Merged
Conversation
payload 값으로 임의의 데이터를 작성하여 쓰레기 값을 추가하였습니다. 브루트포스 공격 방지용으로 사용됩니다. 토큰은 1시간짜리로 발급됩니다. 기능작성 부분에 최대한 기능만을 작성하기 위해 클린 코딩을 하였습니다.
ejsRenderFile 함수와 sendMail 함수를 별도로 작성하여 기능 작성 부분에서 최대한 깔끔하게 작성 할수 있도록 했습니다. ejsRenderFile 에서는 purpose를 통해 어떠한 목적으로 사용할 것인지를 명시 하면 그에 맞는 데이터들을 ejs 파일에 작성합니다.
tls 연결을 사용합니다. 풀링 연결을 지원합니다. smtp 서버는 gmail로 사용합니다. 구글 계정을 별도로 추가 생성하였습니다.하루 100건의 메일만 허용합니다.
클라이언트가 인증 메일을 확인 후 인증하기를 누를 경우 자체처리 할 수 있도록 작성했습니다. 토큰에 담긴 id 값을 확인 하여 pending 값을 업데이트합니다. 이미 인증이 된 유저일 경우 pendingValidValueCheck 함수에서 처리합니다. 그 이후 작동합니다.
tokenParser에 이미 작성 되어 있는 verify 기능을 별도로 추가 작성 했습니다. ejs 파일 형식에는 Authorization 헤더 양식을 따르지 않은 토큰이 작성되어 있습니다. 이를 별도의 작업 없이 진행 하기 위해 작성했습니다.
Open
4 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 타입
반영 브랜치
feat/20-메일인증확인 -> dev-back
변경 사항
nodemailer , nodemiler-smtp-transport , ejs 모듈을 설치 했습니다.
nodemailer 설정 파일을 작성 했습니다.
메일 인증 양식 ejs 파일을 작성했습니다.
인증 메일 보내기 API를 작성 하면서 nodemailer 관련 코드는 별도의 함수로 클린코딩 작업 했습니다.
클라이언트가 메일 인증 메일에서 인증하기를 누를 경우 클라이언트 메일 측에서 백엔드 서버 측으로 pending 값 update에 관련하여 자동적으로 요청하게 됩니다.