Email Authentication + JWT
[POST] /auth/authentiaction/
// header
{ "Content-Type": "application/json" }
// body
{
"email": "{email}",
"password1": "{password}",
"password2": "{password}",
}
{ "message": "{email}로 인증 코드를 발송했습니다." }
- 유효한 링크로 요청이 들어오면, 사용자 속성의
is_activate = True
로 변경하여 계정을 활성화 시킵니다.
- 해당 링크는 자동으로 리다이렉트됩니다.
[GET] /auth/authentiaction/?token={token}&uid64={user}
- 해당 링크의 유효시간은 1분으로
Redis
에서 자동으로 삭제 됩니다.
{ "message": "유효하지 않은 인증입니다. 다시 진행하세요"}
// header
{ "Content-Type": "application/json" }
// body
{
"email": "{email}",
"password": "{password}",
}
- 유저정보가 일치한다면,
access_token
과 refresh token
을 반환합니다.
{
"access_token": "{access_token}",
"refresh_token": "{refresh_token}"
}
// header
{
"Content-Type": "application/json",
"Authorization": "{access_token}"
}
{ "message": "유효한 사용자입니다." }
// header
{
"Content-Type": "application/json",
"Authorization": "{refresh_token}"
}
{
"access_token": "{access_token}"
}
Python 3.6.7
버전의 virtualenv 환경에서 작업을 진행합니다.
mysql 8.0.18
과 redis
를 사용합니다.
pip install -r requirements.txt
Database and Email Settings
mv _db.json db.json & vi db.json
mv _email.json email.json & vi db.json
python manage.py runserver