> For the complete documentation index, see [llms.txt](https://movie-team.gitbook.io/movieteam/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://movie-team.gitbook.io/movieteam/kakao/undefined.md).

# 회원가입/로그인/로그아웃

## 카카오 로그인 API 요청

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:8000/accounts/kakao/login/`

{% tabs %}
{% tab title="302: Found " %}
![](https://3944068060-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp2oWcrqVAkCEcobUkmLt%2Fuploads%2FPF4QUZTjBq0M7TX4oIoK%2Fimage.png?alt=media\&token=5cc52bc4-f13b-43d2-a233-924434fb2606)<http://127.0.0.1:8000/accounts/kakao/login/callback/> \
redirect&#x20;
{% endtab %}
{% endtabs %}

## 카카오 등록 정보 기반 회원가입/로그인

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:8000/accounts/kakao/login/callback/`

{% tabs %}
{% tab title="200: OK 해당 카카오 유저 닉네임과 username이 같은 자체 유저가 있는 경우" %}

````json
```json
// gender { true: male, false: female }
{
    "user": {
        "id": 1,
        "password": "****",
        "last_login": null,
        "username": "kakao username",
        "email": "email",
        "first_name": "False",
        "last_name": "False",
        "is_superuser": false,
        "is_active": true,
        "is_staff": false,
        "created_at": "2023-11-20T00:25:29.788726Z",
        "updated_at": "2023-11-20T00:25:29.788745Z",
        "social": true,
        "gender": true,
        "birth": "1999-12-24",
        "age": 23,
        "groups": [],
        "user_permissions": []
    },
    "message": "signup successs",
    "token": {
        "access": "access_token",
        "refresh": "refresh_token"
    }
}
```
````

{% endtab %}

{% tab title="200: OK 해당 카카오 유저 정보로 회원가입한 기록이 있을 경우" %}

````json
```json
{
    "message": "login successs",
    "token": {
        "access": "access_token",
        "refresh": "refresh_token"
    }
}
```
````

{% endtab %}

{% tab title="200: OK 해당 카카오 유저 정보로 자체 회원가입이나 카카오 회원가입 한 적 없는 경우" %}

````json
```json
// gender { true: male, false: female }
{
    "user": {
        "id": 1,
        "password": "****",
        "last_login": null,
        "username": "username",
        "email": "email",
        "first_name": "False",
        "last_name": "False",
        "is_superuser": false,
        "is_active": true,
        "is_staff": false,
        "created_at": "2023-11-20T00:25:29.788726Z",
        "updated_at": "2023-11-20T00:25:29.788745Z",
        "social": true,
        "gender": true,
        "birth": "1999-12-24",
        "age": 23,
        "groups": [],
        "user_permissions": []
    },
    "message": "signup successs",
    "token": {
        "access": "access_token",
        "refresh": "refresh_token"
    }
}
```
````

{% endtab %}

{% tab title="400: Bad Request 이미 존재하는 이메일일 경우" %}

````json
```json
{
    "message": "already exsist email"
}
```
````

{% endtab %}
{% endtabs %}

## 카카오 토큰 재발급

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:8000/accounts/kakao/refresh/`

#### Cookies

| Name                                      | Type   | Description    |
| ----------------------------------------- | ------ | -------------- |
| refresh<mark style="color:red;">\*</mark> | String | refresh\_token |

## 카카오 로그아웃

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:8000/accounts/kakao/logout/`

#### Cookies

| Name                                     | Type   | Description   |
| ---------------------------------------- | ------ | ------------- |
| access<mark style="color:red;">\*</mark> | String | access\_token |
