PhoenixKitWeb.Plugs.EnsureOAuthScheme (phoenix_kit v1.5.1)
View SourceEnsures correct HTTPS scheme for OAuth callback URL generation behind reverse proxies.
This plug checks (in order):
X-Forwarded-Protoheader (nginx/apache standard)- Explicit
:phoenix_kit, :oauth_base_urlconfig - Endpoint URL configuration
Usage
Automatically included in OAuth controller. No manual setup required.
Configuration (Optional)
For edge cases where headers aren't available:
config :phoenix_kit,
oauth_base_url: "https://example.com"