PhoenixKit.Users.OAuth (phoenix_kit v1.5.1)

View Source

OAuth authentication context for PhoenixKit.

Handles OAuth authentication flows for external providers like Google, Apple, GitHub.

This module requires the Ueberauth library to be installed. If Ueberauth is not available, a fallback module with basic functionality will be used instead.

Summary

Functions

Finds an existing user by email or creates a new one from OAuth data.

Gets all OAuth providers for a user.

Handles OAuth callback from Ueberauth.

Links an OAuth provider to a user account.

Unlinks an OAuth provider from a user.

Functions

find_or_create_user(oauth_data, track_geolocation \\ false, ip_address \\ nil)

Finds an existing user by email or creates a new one from OAuth data.

get_user_oauth_providers(user_id)

Gets all OAuth providers for a user.

handle_oauth_callback(auth, opts \\ [])

Handles OAuth callback from Ueberauth.