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

# auth

1. 로그인

## 로그인 기능

<mark style="color:green;">`POST`</mark> `http://localhost:8080/api/auth/login`

#### Request Body

| Name                                       | Type   | Description                    |
| ------------------------------------------ | ------ | ------------------------------ |
| <mark style="color:red;">\*</mark>         | String | <p>사용자 아이디</p><p>(email형식)</p> |
| password<mark style="color:red;">\*</mark> | String | 사용자 비밀번호                       |

{% tabs %}
{% tab title="200: OK 로그인 성공" %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

2. 회원가입

## 회원가입 기능

<mark style="color:green;">`POST`</mark> `http://localhost:8080/api/auth/signup`

#### Request Body

| Name                                           | Type   | Description                    |
| ---------------------------------------------- | ------ | ------------------------------ |
| username<mark style="color:red;">\*</mark>     | String | <p>사용자 아이디</p><p>(email형식)</p> |
| introduction<mark style="color:red;">\*</mark> | String | 사용자 자기소개                       |
| nickname<mark style="color:red;">\*</mark>     | String | 사용자 닉네임                        |
| password<mark style="color:red;">\*</mark>     | String | 사용자 비밀번호                       |

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

{% endtab %}

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

{% endtab %}
{% endtabs %}

3. 카카오 로그인

## 카카오 로그인

<mark style="color:blue;">`GET`</mark> `http://localhost:8080/api/auth/kakao/callback`

#### Request Body

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| code<mark style="color:red;">\*</mark> | String | 카카오 인증 코드   |

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

{% endtab %}

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

{% endtab %}
{% endtabs %}

4. 네이버 로그인

## 네이버 로그인

<mark style="color:blue;">`GET`</mark> `http://localhost:8080/api/auth/naver/callback`

#### Request Body

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| code<mark style="color:red;">\*</mark> | String | 네이버 인증 코드   |

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

{% endtab %}

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

{% endtab %}
{% endtabs %}

5. 구글  로그인

## 구글  로그인

<mark style="color:blue;">`GET`</mark> `http://localhost:8080/api/auth/google/callback`

#### Request Body

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| code<mark style="color:red;">\*</mark> | String | 구글 인증 코드    |

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

{% endtab %}

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

{% endtab %}
{% endtabs %}

6. 엑세스 토큰 갱신

<mark style="color:blue;">`GET`</mark> `http://localhost:8080/api/auth/refresh/access-token`

엑세스 토큰 갱신

#### Cookies

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT 엑세스 토큰값 |
| RefreshToken<mark style="color:red;">\*</mark>  | String | 리프레시 토큰값    |

{% tabs %}
{% tab title="200: OK 토큰 갱신 성공" %}

{% endtab %}

{% tab title="400: Bad Request 토큰 갱신 실패" %}

{% endtab %}
{% endtabs %}
