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

# Users

## 회원가입

<mark style="color:green;">`POST`</mark> `/users/signup`

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| email<mark style="color:red;">\*</mark>    | string |             |
| password<mark style="color:red;">\*</mark> | string |             |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    // Response
    message: "Successfully Signed Up"
}
```

{% endtab %}

{% tab title="409: Conflict " %}

```javascript
{
    // Response
    message: "nickname or email already exists"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 로그인

<mark style="color:green;">`POST`</mark> `/users/signin`

#### Headers

| Name                                              | Type    | Description  |
| ------------------------------------------------- | ------- | ------------ |
| withCredentials<mark style="color:red;">\*</mark> | boolean | must be true |

#### Request Body

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

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

```javascript
{
    // Response
    message: "Successfully Logged In"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 로그아웃

<mark style="color:green;">`POST`</mark> `/users/signout`

{% tabs %}
{% tab title="205: Reset Content " %}

```javascript
{
    // Response
    message: "Successfully Logged Out"    
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 아이디 찾기 요청

<mark style="color:green;">`POST`</mark> `/users/find_email`

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: {
        email: User's Email
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}
{% endtabs %}

## 카카오 소셜 로그인 요청

<mark style="color:green;">`POST`</mark> `/users/oauth`

#### Query Parameters

| Name                                   | Type   | Description       |
| -------------------------------------- | ------ | ----------------- |
| code<mark style="color:red;">\*</mark> | string | AuthorizationCode |

#### Headers

| Name                                              | Type    | Description  |
| ------------------------------------------------- | ------- | ------------ |
| withCredentials<mark style="color:red;">\*</mark> | boolean | must be true |

{% tabs %}
{% tab title="200: OK Response with Cookie" %}

```javascript
{
    // Response
    message: "Logged in with your Kakao account"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 유저 정보 수정

<mark style="color:purple;">`PATCH`</mark> `/users/update`

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: {
        userInfo: modifiedUserData,
    },
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
    data: null,
    message: "not Authorized"
}
```

{% endtab %}

{% tab title="409: Conflict " %}

```javascript
{
    // Response
    data: null,
    message: "nickname already exists",
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 프로필 정보 수정

<mark style="color:purple;">`PATCH`</mark> `/users/update/profile/:user_id`

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

```javascript
{
    // Response
    message: "Profile has been updated",
    data: UpdatedUserInfo
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 회원 탈퇴

<mark style="color:red;">`DELETE`</mark> `/users/withdrawal`

{% tabs %}
{% tab title="204: No Content " %}

```javascript
{
    // Response
    message: "Successfully withdrew"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 유저 정보 조회

<mark style="color:blue;">`GET`</mark> `/users/auth`

#### Headers

| Name                                              | Type   | Description  |
| ------------------------------------------------- | ------ | ------------ |
| withCredentials<mark style="color:red;">\*</mark> | string | must be true |

#### Cookies

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| accessToken<mark style="color:red;">\*</mark> | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: {
        userInfo: userInfo
    }
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
    data: null,
    message: 'not Authorized'
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
    data: null,
    message: 'No matching user information'
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## 등록된 이메일로 비밀번호 인증 메일 전송

<mark style="color:blue;">`GET`</mark> `/users/find_password`

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

```javascript
{
    // Response
    message: "ok"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}
{% endtabs %}

## 이메일 찾기

<mark style="color:blue;">`GET`</mark> `/users/find_email?nickname&mobile`

#### Query Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| nickname<mark style="color:red;">\*</mark> | string |             |
| mobile<mark style="color:red;">\*</mark>   | string |             |

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

```javascript
{
    // Response
    message: "ok",
    data: findMatchedEmail
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    // Response
    message: "No matching user information"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
    message: "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}
