auth-content.md
基本信息
- 类型: React 组件
- 路径:
./src/components/auth/auth-content.tsx
功能描述
认证内容容器组件,根据配置动态渲染 OAuth 登录按钮和凭证表单。支持登录和注册两种模式,当同时存在 OAuth 和凭证认证时显示分隔线。
导出内容
Props
| 属性 | 类型 | 说明 |
| providers | string[] | 启用的认证提供方列表(如 ['github', 'credentials']) |
| mode | `"login" \ | "register"` | 认证模式:登录或注册 |
| useCloneBranding | boolean | 是否使用克隆站点品牌(默认 false,控制是否显示 GitHub 归属提示) |
支持的认证提供方
| 提供方 | 显示名称 |
| github | GitHub |
| google | Google |
| azure | Microsoft |
| apple | Apple |
| credentials | Email |
子组件
LoginForm - 邮箱密码登录表单
RegisterForm - 邮箱密码注册表单
OAuthButton - OAuth 登录按钮
依赖
next-intl - useTranslations
./login-form - LoginForm
./register-form - RegisterForm
./oauth-button - OAuthButton