Open seokulee opened 1 month ago
GET /api/auth/42/login/
GET
302 Found
GET /api/auth/42/callback/
code
string
200 OK
{ "message": "2FA code sent to your email. Please verify to complete login.", "username": "your_username" }
{ "refresh": "your_refresh_token", "access": "your_access_token", "username": "user_username", "email": "user_email", "avatar": "avatar_url" }
POST /api/auth/2fa/verify/
POST
username
otp_code
{ "refresh": "your_refresh_token", "access": "your_access_token" }
400 Bad Request
{ "error": "Invalid OTP code." }
POST /api/auth/2fa/toggle/
Authorization
Bearer <access_token>
enable_2fa
boolean
true
false
{ "message": "2FA enabled successfully." }
{ "message": "2FA disabled successfully." }
TODO
API 명세서
1.
GET /api/auth/42/login/
GET
302 Found
- 42 OAuth 로그인 페이지로 리디렉션2.
GET /api/auth/42/callback/
GET
code
(필수):string
- 42 OAuth로부터 받은 인증 코드200 OK
200 OK
3.
POST /api/auth/2fa/verify/
POST
username
(필수):string
- 사용자 이름otp_code
(필수):string
- 이메일로 전송된 2FA OTP 코드200 OK
400 Bad Request
4.
POST /api/auth/2fa/toggle/
POST
Authorization
:Bearer <access_token>
- 사용자의 인증 토큰enable_2fa
(선택):boolean
-true
이면 2FA 활성화,false
이면 비활성화 (기본값:true
)200 OK