Search documentation of phoenix_kit

# PhoenixKit.Users.OAuth (phoenix_kit v1.7.87)

Copy Markdown 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

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_uuid)

Gets all OAuth providers for a user.

handle_oauth_callback(auth, opts \\ [])

Handles OAuth callback from Ueberauth.

link_oauth_provider(user, oauth_data)

Links an OAuth provider to a user account.

unlink_oauth_provider(user_uuid, provider)

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_uuid)

Gets all OAuth providers for a user.

# handle_oauth_callback(auth, opts \\ [])

Handles OAuth callback from Ueberauth.

# link_oauth_provider(user, oauth_data)

Links an OAuth provider to a user account.

# unlink_oauth_provider(user_uuid, provider)

Unlinks an OAuth provider from a user.