> 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/accounts/undefined-2.md).

# 로그인/로그아웃/회원정보수정

## 로그인 요청

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:8000/api/login/`

#### Request Body

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

{% tabs %}
{% 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": false,
        "gender": true,
        "birth": "1999-12-24",
        "age": 23,
        "groups": [],
        "user_permissions": []
    },
    "message": "login successs",
    "token": {
        "access": "access_token",
        "refresh": "refresh_token"
    }
}
```
````

{% endtab %}
{% endtabs %}

## 로그아웃 요청

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

#### Headers

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | "Bearer " + 발급 받은 access token |

#### Request Body

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

{% tabs %}
{% tab title="202: Accepted " %}

````json
```json
{
    "message": "Logout success"
}
```
````

{% endtab %}
{% endtabs %}

## 회원 정보 수정 요청

<mark style="color:orange;">`PUT`</mark> `http://127.0.0.1:8000/api/update/`

#### Headers

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | "Bearer " + 발급 받은 access token |

#### Request Body

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| username    | String  |             |
| email       | String  |             |
| birth       | String  |             |
| gender      | Boolean |             |
| first\_name | String  |             |
| last\_name  | String  |             |

{% tabs %}
{% tab title="200: OK " %}

````json
```json
{
    "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": false,
        "gender": true,
        "birth": "1999-12-24",
        "age": 23,
        "groups": [],
        "user_permissions": []
    },
    "message": "update successs"
}
```
````

{% endtab %}
{% endtabs %}
