ex
request
{
"phone": "01000000000",
"password": "Password!@"
}
response
HTTP Status: 201
{
"user": {
"id": 1,
"phone": "01000000000",
"kakao_id": null
},
"token": {
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjY3MTQ0NTQzLCJpYXQiOjE2NjcxNDQ1NDAsImp0aSI6ImY3MjVkNDBkZDg5OTRmZDM4MGRhMTU1ZTJkZGQwMTcxIiwidXNlcl9pZCI6MX0.O_OcrOirF9he6jBPWsSJzqrbOwz72X7QEogQ9rVOdts",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY2NzE0NDk2MCwiaWF0IjoxNjY3MTQ0NTQwLCJqdGkiOiJkMjg3NDI5YjZmZmI0NmExOTg5N2U0ZjBiNmE3NjEwZiIsInVzZXJfaWQiOjF9.4ZK37ia7WSM4tN2_Lfy9lL9uLSo2vTt5iUHIBDfSVIA"
}
}
HTTP Status: 401
{
"detail": "이 토큰은 모든 타입의 토큰에 대해 유효하지 않습니다",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "유효하지 않거나 만료된 토큰"
}
]
}
/accounts/token_refresh/
로 refresh_token을 담아 POST요청{
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY2NzE0NDk2MCwiaWF0IjoxNjY3MTQ0NTQwLCJqdGkiOiJkMjg3NDI5YjZmZmI0NmExOTg5N2U0ZjBiNmE3NjEwZiIsInVzZXJfaWQiOjF9.4ZK37ia7WSM4tN2_Lfy9lL9uLSo2vTt5iUHIBDfSVIA"
}
HTTP Status: 200
{
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjY3MTQ0NTY4LCJpYXQiOjE2NjcxNDQ1NDAsImp0aSI6IjQ2ZjM5ZjkyMWU3MTRhMmZiMmU1ZTM2MTI5ZjFmMzdkIiwidXNlcl9pZCI6MX0.D8VK53fqHLDWyN9SCyZtVHpfM8zxVRh43nd6tfRuBgo",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY2NzE0NDk4NSwiaWF0IjoxNjY3MTQ0NTY1LCJqdGkiOiIxMDNjOTQ2NmMyNWI0MjI2YTQ0YTQyNzQ2ODM2ZGZjOSIsInVzZXJfaWQiOjF9.ee49gFY1iuYz3Vu7Bp5y7c3ZGts8S_Gn_GFnF3Qp5ck"
}
/accounts/token_refresh/
로 보낼 때 백엔드의 응답HTTP Status: 401
{
"detail": "유효하지 않거나 만료된 토큰",
"code": "token_not_valid"
}
JWT 포함 시 login 등 다른 인허가 필요없는 URL에서도 401 에러 발생
/acconts/token_refresh
로 보냄 /accounts/token_refresh
에서도 401 응답이 오면 유저를 강제 로그아웃