# 인증

Rememberizer는 사용자 계정 및 세션 관리를 위한 여러 인증 엔드포인트를 제공합니다. 이 문서는 사용 가능한 인증 API를 설명합니다.

## 회원가입

{% openapi src="/files/fAmF2Kwil50sF5cXMoEX" path="/auth/signup/" method="post" %}
[rememberizer\_openapi.yml](https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3)
{% endopenapi %}

### 예제 요청

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/signup/ \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "secure_password",
    "name": "John Doe",
    "captcha": "recaptcha_response"
  }'
```

{% hint style="info" %}
`recaptcha_response`를 실제 reCAPTCHA 응답으로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const signUp = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/signup/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email: 'user@example.com',
      password: 'secure_password',
      name: 'John Doe',
      captcha: 'recaptcha_response'
    })
  });
  
  const data = await response.json();
  console.log(data);
};

signUp();
```

{% hint style="info" %}
`recaptcha_response`를 실제 reCAPTCHA 응답으로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def sign_up():
    headers = {
        "Content-Type": "application/json"
    }
    
    payload = {
        "email": "user@example.com",
        "password": "secure_password",
        "name": "John Doe",
        "captcha": "recaptcha_response"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/signup/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

sign_up()
```

{% hint style="info" %}
`recaptcha_response`를 실제 reCAPTCHA 응답으로 교체하세요.
{% endhint %}
{% endtab %}
{% endtabs %}

## 로그인

{% openapi src="/files/fAmF2Kwil50sF5cXMoEX" path="/auth/signin/" method="post" %}
[rememberizer\_openapi.yml](https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3)
{% endopenapi %}

### 예제 요청

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/signin/ \
  -H "Content-Type: application/json" \
  -d '{
    "login": "user@example.com",
    "password": "secure_password",
    "captcha": "recaptcha_response"
  }'
```

{% hint style="info" %}
`recaptcha_response`를 실제 reCAPTCHA 응답으로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const signIn = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/signin/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      login: 'user@example.com',
      password: 'secure_password',
      captcha: 'recaptcha_response'
    })
  });
  
  // 응답에서 인증 쿠키 확인
  if (response.status === 204) {
    console.log("로그인 성공!");
  } else {
    console.error("로그인 실패!");
  }
};

signIn();
```

{% hint style="info" %}
`recaptcha_response`를 실제 reCAPTCHA 응답으로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def sign_in():
    headers = {
        "Content-Type": "application/json"
    }
    
    payload = {
        "login": "user@example.com",
        "password": "secure_password",
        "captcha": "recaptcha_response"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/signin/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    if response.status_code == 204:
        print("로그인 성공!")
    else:
        print("로그인 실패!")

sign_in()
```

{% hint style="info" %}
`recaptcha_response`를 실제 reCAPTCHA 응답으로 교체하세요.
{% endhint %}
{% endtab %}
{% endtabs %}

## 이메일 인증

{% openapi src="/files/fAmF2Kwil50sF5cXMoEX" path="/auth/verify-email/" method="post" %}
[rememberizer\_openapi.yml](https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3)
{% endopenapi %}

### 예제 요청

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/verify-email/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "verification_code": "123456"
  }'
```

{% hint style="info" %}
`YOUR_JWT_TOKEN`을 실제 JWT 토큰으로 교체하고, 이메일로 전송된 인증 코드를 사용하세요.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const verifyEmail = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/verify-email/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      verification_code: '123456'
    })
  });
  
  if (response.status === 200) {
    console.log("이메일 인증 성공!");
  } else {
    console.error("이메일 인증 실패!");
  }
};

verifyEmail();
```

{% hint style="info" %}
`YOUR_JWT_TOKEN`을 실제 JWT 토큰으로 교체하고, 이메일로 전송된 인증 코드를 사용하세요.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def verify_email():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "verification_code": "123456"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/verify-email/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    if response.status_code == 200:
        print("이메일 인증 성공!")
    else:
        print("이메일 인증 실패!")

verify_email()
```

{% hint style="info" %}
`YOUR_JWT_TOKEN`을 실제 JWT 토큰으로 교체하고, 이메일로 전송된 인증 코드를 사용하세요.
{% endhint %}
{% endtab %}
{% endtabs %}

## 토큰 관리

{% openapi src="/files/fAmF2Kwil50sF5cXMoEX" path="/auth/custom-refresh/" method="post" %}
[rememberizer\_openapi.yml](https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3)
{% endopenapi %}

### 예제 요청

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/custom-refresh/ \
  -b "refresh_token=YOUR_REFRESH_TOKEN"
```

{% hint style="info" %}
이 엔드포인트는 인증을 위해 쿠키를 사용합니다. 새로 고침 토큰은 쿠키로 전송되어야 합니다.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const refreshToken = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/custom-refresh/', {
    method: 'POST',
    credentials: 'include' // 이 요청에 쿠키를 포함합니다
  });
  
  if (response.status === 204) {
    console.log("토큰이 성공적으로 새로 고쳐졌습니다!");
  } else {
    console.error("토큰 새로 고침에 실패했습니다!");
  }
};

refreshToken();
```

{% hint style="info" %}
이 엔드포인트는 인증을 위해 쿠키를 사용합니다. 애플리케이션이 요청에 자격 증명을 포함하는지 확인하세요.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def refresh_token():
    cookies = {
        "refresh_token": "YOUR_REFRESH_TOKEN"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/auth/custom-refresh/",
        cookies=cookies
    )
    
    if response.status_code == 204:
        print("토큰이 성공적으로 새로 고쳐졌습니다!")
    else:
        print("토큰 새로 고침에 실패했습니다!")

refresh_token()
```

{% hint style="info" %}
`YOUR_REFRESH_TOKEN`을 실제 새로 고침 토큰으로 교체하세요.
{% endhint %}
{% endtab %}
{% endtabs %}

## 로그아웃

{% openapi src="/files/fAmF2Kwil50sF5cXMoEX" path="/auth/custom-logout/" method="post" %}
[rememberizer\_openapi.yml](https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3)
{% endopenapi %}

### 예제 요청

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/custom-logout/
```

{% hint style="info" %}
이 엔드포인트는 인증 쿠키를 지웁니다.
{% endhint %}

```javascript
const logout = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/custom-logout/', {
    method: 'POST',
    credentials: 'include' // 이 요청에 쿠키를 포함합니다.
  });
  
  if (response.status === 204) {
    console.log("로그아웃 성공!");
  } else {
    console.error("로그아웃 실패!");
  }
};

logout();
```

{% hint style="info" %}
이 엔드포인트는 인증을 위해 쿠키를 사용합니다. 애플리케이션이 요청에 자격 증명을 포함하는지 확인하세요.
{% endhint %}

```python
import requests

def logout():
    session = requests.Session()
    
    response = session.post(
        "https://api.rememberizer.ai/api/v1/auth/custom-logout/"
    )
    
    if response.status_code == 204:
        print("로그아웃 성공!")
    else:
        print("로그아웃 실패!")

logout()
```

{% hint style="info" %}
이 엔드포인트는 인증 쿠키를 지웁니다.
{% endhint %}

{% endtabs %


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rememberizer.ai/ko/undefined-1/api-docs/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
