auth-content.md

auth-content.md

基本信息

  • 类型: React 组件
  • 路径: ./src/components/auth/auth-content.tsx

功能描述

认证内容容器组件,根据配置动态渲染 OAuth 登录按钮和凭证表单。支持登录和注册两种模式,当同时存在 OAuth 和凭证认证时显示分隔线。

导出内容

  • AuthContent - 主组件函数

Props

属性类型说明
providersstring[]启用的认证提供方列表(如 ['github', 'credentials'])
mode`"login" \"register"`认证模式:登录或注册
useCloneBrandingboolean是否使用克隆站点品牌(默认 false,控制是否显示 GitHub 归属提示)

支持的认证提供方

提供方显示名称
githubGitHub
googleGoogle
azureMicrosoft
appleApple
credentialsEmail

子组件

  • LoginForm - 邮箱密码登录表单
  • RegisterForm - 邮箱密码注册表单
  • OAuthButton - OAuth 登录按钮

依赖

  • next-intl - useTranslations
  • ./login-form - LoginForm
  • ./register-form - RegisterForm
  • ./oauth-button - OAuthButton
← 返回目录