LightningWeb.CredentialLive.OAuthErrorFormatter (Lightning v2.13.5)
View SourceProvides human-readable error messages for OAuth-related errors.
This module centralizes all error message formatting to ensure consistent, helpful user feedback across the OAuth flow.
Summary
Functions
Determines the appropriate alert type for Phoenix components based on severity.
Formats an OAuth validation error into user-friendly display information.
Functions
@spec alert_type(LightningWeb.CredentialLive.OAuthErrorFormatter.ErrorDisplay.t()) :: String.t()
Determines the appropriate alert type for Phoenix components based on severity.
@spec format_error(any(), String.t() | nil) :: LightningWeb.CredentialLive.OAuthErrorFormatter.ErrorDisplay.t()
Formats an OAuth validation error into user-friendly display information.
Parameters
- error: The error to format (OauthValidation.Error or other error types)
- provider: The OAuth provider name (e.g., "Google", "GitHub")
Returns
An ErrorDisplay struct with formatted error information