认证
Rememberizer 提供了多个认证端点来管理用户账户和会话。本文档概述了可用的认证 API。
注册
示例请求
curl -X POST \
https://api.rememberizer.ai/api/v1/auth/signup/ \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "secure_password",
"name": "John Doe",
"captcha": "recaptcha_response"
}'
登录
示例请求
curl -X POST \
https://api.rememberizer.ai/api/v1/auth/signin/ \
-H "Content-Type: application/json" \
-d '{
"login": "[email protected]",
"password": "secure_password",
"captcha": "recaptcha_response"
}'
邮箱验证
示例请求
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"
}'
令牌管理
示例请求
curl -X POST \
https://api.rememberizer.ai/api/v1/auth/custom-refresh/ \
-b "refresh_token=YOUR_REFRESH_TOKEN"
登出
示例请求
curl -X POST \
https://api.rememberizer.ai/api/v1/auth/custom-logout/
const logout = async () => {
const response = await fetch('https://api.rememberizer.ai/api/v1/auth/custom-logout/', {
method: 'POST',
credentials: 'include' // 这将包括请求中的 cookies
});
if (response.status === 204) {
console.log("注销成功!");
} else {
console.error("注销失败!");
}
};
logout();
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()
{% endtabs %
Last updated