Skip to main content

default

Admin Docs


Variable: default

const default: React.FC<Props>

Defined in: src/components/Auth/OAuthButton/GitHubOAuthButton.tsx:30

GitHub OAuth authentication button component.

Handles GitHub OAuth flow by redirecting users to GitHub's authentication page and storing the authentication mode (login/register/link) for callback processing.

Returns

A GitHub-branded OAuth button

Example

// Sign-in button
<GitHubOAuthButton mode="login" fullWidth />

// Link account button
<GitHubOAuthButton mode="link" size="sm" />

Remarks

  • Uses OAuth state parameter to pass mode, provider, and CSRF nonce through the OAuth flow
  • Also stores configuration in sessionStorage as fallback
  • The callback handler extracts mode and nonce from state parameter (or sessionStorage) and calls the appropriate OAuth flow handler (handleOAuthLogin or handleOAuthLink)
  • State parameter format: "mode:provider:nonce" (e.g., "login:GITHUB:uuid-v4")
  • CSRF protection: Nonce is validated in callback to prevent CSRF attacks