# user

## 회원가입 유저 이메일 확인

<mark style="color:blue;">`GET`</mark> `/cert/:email`

#### Path Parameters

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

{% tabs %}
{% tab title="200: OK 유저 이메일 확인 성공" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error 유저 이메일 확인 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 구글 로그인 정보 조회

<mark style="color:blue;">`GET`</mark> `/user/googleCallback`

{% tabs %}
{% tab title="200: OK 정보 조회 성공" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error 정보 조회 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 카카오 로그인 정보 조회

<mark style="color:blue;">`GET`</mark> `/user/kakaoCallback`

{% tabs %}
{% tab title="200: OK 정보조회 성공" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error 정보조회 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 카카오 로그인

<mark style="color:blue;">`GET`</mark> `/user/kakao`

#### Request Body

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

{% tabs %}
{% tab title="201: Created 로그인 성공" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="400: Bad Request 로그인 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 유저정보조회

<mark style="color:blue;">`GET`</mark> `/user/info`&#x20;

#### Cookies

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

{% tabs %}
{% tab title="200: OK 유저정보 조회 성공" %}

```javascript
{
    "email":"hobak@gmail.com",
    "img":"/profile/123477732134-filename.png",
    "nickname":"파이리",
    "town":"서구 둔산동",
    "address":"대전광역시 서구 둔산동",
    "reliability": 0,
    "createdAt": "2021-11-02T20:07:29.000Z",
    "updatedAt": "2021-11-02T20:07:29.000Z"
}
```

{% endtab %}

{% tab title="403: Forbidden 유저정보 조회 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 구글 로그인

<mark style="color:green;">`POST`</mark> `/user/google`

#### Request Body

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

{% tabs %}
{% tab title="201: Created 로그인 성공" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="400: Bad Request 로그인 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 중복된 닉네임 조회

<mark style="color:green;">`POST`</mark> `/user/nickname`

#### Request Body

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

{% tabs %}
{% tab title="200: OK 중복된 닉네임 없음" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="409: Conflict 중복된 닉네임 존재" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 회원가입시 중복이메일 확인

<mark style="color:green;">`POST`</mark> `/user/email`

#### Request Body

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

{% tabs %}
{% tab title="200: OK 중복된 이메일 없음" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="409: Conflict 중복된 이메일 있음" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 비밀번호 수정

<mark style="color:purple;">`PATCH`</mark> `/user/password`&#x20;

#### Cookies

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

#### Request Body

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

{% tabs %}
{% tab title="200: OK 비밀번호 수정 성공" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="403: Forbidden 비밀번호 수정 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 회원정보 수정

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

#### Cookies

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

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| nickname | String |             |
| address  | String |             |
| img      | String |             |

{% tabs %}
{% tab title="200: OK 회원정보 수정 성공" %}

```javascript
{
    "nickname":"호박고구마",
    "address":"대전광역시 유성구 장대동",
    "town":"유성구 장대동",
    "img":"/profile/12359923145-filename.png"
}
```

{% endtab %}

{% tab title="403: Forbidden 회원정보 수정 실패" %}

```javascript
{
    "message":"invalid token"   
}
```

{% endtab %}

{% tab title="409: Conflict 회원정보 중복" %}

```javascript
{
    "message":"duplicated nickname"
}
```

{% endtab %}
{% endtabs %}

## 로그아웃

<mark style="color:green;">`POST`</mark> `/user/signout` &#x20;

#### Cookies

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

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

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="403: Forbidden 로그아웃 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 회원가입요청

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

#### Request Body

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

{% tabs %}
{% tab title="201: Created 회원가입 성공" %}

```javascript
{
   
}
```

{% endtab %}

{% tab title="400: Bad Request 회원가입 실패" %}

```javascript
{
}
```

{% endtab %}
{% endtabs %}

## 로그인

<mark style="color:green;">`POST`</mark> `/user/signin`&#x20;

#### 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
}
```

{% endtab %}

{% tab title="403: Forbidden 로그인 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 회원탈퇴

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

#### Cookies

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

{% tabs %}
{% tab title="204: No Content 회원탈퇴 성공" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="403: Forbidden 회원탈퇴 실패" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}
