Files
medical-mall/pages/user/test/CONFIG_CHANGED.md
2026-01-26 21:34:17 +08:00

101 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Supabase 配置已修改
## ✅ 已完成的修改
已修改 `supabase_pro/.env` 文件:
```env
ENABLE_EMAIL_AUTOCONFIRM=true # 从 false 改为 true
```
## 🔄 下一步操作
### 重启 Supabase Auth 服务
修改配置后,**必须重启服务**才能生效:
```bash
cd supabase_pro
docker-compose restart auth
```
或者重启整个 Supabase
```bash
docker-compose restart
```
### 验证配置
```bash
# 检查配置是否已修改
grep ENABLE_EMAIL_AUTOCONFIRM supabase_pro/.env
```
应该显示:`ENABLE_EMAIL_AUTOCONFIRM=true`
---
## 📝 配置说明
### 当前配置
-`ENABLE_EMAIL_SIGNUP=true` - 允许邮箱注册
-`ENABLE_EMAIL_AUTOCONFIRM=true` - **跳过邮件验证**,注册后立即可以登录
### 效果
1. **注册时**
- 用户填写邮箱和密码
- 点击注册
- Supabase 直接创建用户(不发送邮件)
- 返回 session用户自动登录
2. **登录时**
- 使用注册的邮箱和密码
- 可以直接登录(无需邮箱确认)
---
## 🧪 测试步骤
1. **重启服务**(如果还没重启)
```bash
cd supabase_pro
docker-compose restart auth
```
2. **测试注册**
- 在前端注册新用户
- 应该看到 "注册成功" 提示
- 自动跳转到登录页面(或直接进入应用)
3. **测试登录**
- 使用注册的邮箱和密码登录
- 应该可以成功登录
4. **验证数据库**
```sql
-- 检查新注册的用户
SELECT id, email, email_confirmed_at, created_at
FROM auth.users
ORDER BY created_at DESC
LIMIT 5;
-- 检查 ak_users 表
SELECT id, email, username, created_at
FROM ak_users
ORDER BY created_at DESC
LIMIT 5;
```
---
## ⚠️ 重要提示
- **修改配置后必须重启服务**,否则配置不会生效
- 如果重启后仍然无法注册,检查服务日志:
```bash
docker-compose logs auth
```