PhoenixKitWeb.Plugs.EnsureOAuthScheme (phoenix_kit v1.5.1)

View Source

Ensures correct HTTPS scheme for OAuth callback URL generation behind reverse proxies.

This plug checks (in order):

  1. X-Forwarded-Proto header (nginx/apache standard)
  2. Explicit :phoenix_kit, :oauth_base_url config
  3. 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"

Summary

Functions

call(conn, opts)

init(opts)