# 用户认证

## login

<mark style="color:green;">`POST`</mark> `https://your_sspanel_domain/auth/login`

&#x20;用户登录

#### Request Body

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| email        | string  | 用户邮箱        |
| passwd       | string  | 用户密码        |
| code         | string  | 用户两步验证码     |
| remember\_me | boolean | 是否记住用户的登录状态 |

{% tabs %}
{% tab title="200 ret:0登录失败，msg中有详细说明
ret:1登录成功" %}

```
{"ret":0,"msg":"\u90ae\u7bb1\u4e0d\u5b58\u5728"}
```

{% endtab %}
{% endtabs %}

## register

<mark style="color:green;">`POST`</mark> `https://your_sspanel_domain/auth/register`

用户注册

#### Request Body

| Name     | Type   | Description                                                      |
| -------- | ------ | ---------------------------------------------------------------- |
| code     | string | 邀请码                                                              |
| email    | string | 申请邮箱                                                             |
| name     | string | 申请用户名                                                            |
| passwd   | string | 设置密码                                                             |
| repasswd | string | 确认密码                                                             |
| imtype   | string | <p>联系方式：<br>1 = 微信<br>2 = QQ<br>3 = Facebook<br>4 = Telegram</p> |
| wechat   | string | 联系方式账号                                                           |

{% tabs %}
{% tab title="200 ret:0 注册失败，msg 中有出错说明。
ret:1 注册成功" %}

```
{"ret":0,"msg":"\u5bc6\u7801\u8bf7\u5927\u4e8e8\u4f4d"}
```

{% endtab %}
{% endtabs %}

## reset

<mark style="color:green;">`POST`</mark> `https://your_sspanel_domain/password/reset`

&#x20;重置密码&#x20;

#### Request Body

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| email | string | 用户邮箱        |

{% tabs %}
{% tab title="200 ret:0 发送失败， msg中有出错详情" %}

```
```

{% endtab %}
{% endtabs %}

## logout

<mark style="color:blue;">`GET`</mark> `https://your_sspanel_domain/logout`

&#x20;用户登出，需要 include cookie。

{% tabs %}
{% tab title="200 注销成功。" %}

```
{ret: 1}
```

{% endtab %}
{% endtabs %}
