Fix critical OAuth bugs and bump version to 1.4.7#139
Merged
Conversation
fix Refactoring opportunities and Code Readability fix dialyzer warning
Issue #1: Preserve Ueberauth base_path during configuration - Function configure_ueberauth_base/0 now preserves existing base_path - Added get_oauth_base_path/0 helper to set default based on URL prefix - Prevents "Ueberauth plugin did not process request" error Issue #2: Fix struct field access using bracket notation - Replaced auth.credentials[:token] with auth.credentials.token - Replaced auth.credentials[:refresh_token] with auth.credentials.refresh_token - Replaced auth.extra[:raw_info] with safe get_raw_info/1 helper - Fixes UndefinedFunctionError when OAuth callback processes response These changes eliminate critical bugs that completely prevented OAuth authentication with Google and other providers. Both issues were discovered during production testing with PhoenixKit v1.4.6. Modified files: - lib/phoenix_kit/users/oauth_config.ex - lib/phoenix_kit/users/oauth.ex All quality checks passed (mix format, credo, dialyzer, test)
Bumped version from 1.4.6 to 1.4.7 Added comprehensive changelog entry documenting: - OAuth base_path preservation fix - OAuth struct field access fix - Impact assessment and upgrade notes Both critical bugs prevented OAuth authentication from working with Google, GitHub, Apple, and Facebook providers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed two critical bugs preventing OAuth authentication with Google and other providers.
Changes
Critical Fixes
Version Update
Technical Details
Issue #1: base_path Preservation
File:
lib/phoenix_kit/users/oauth_config.exconfigure_ueberauth_base/0now preserves existing base_path from configurationget_oauth_base_path/0helper to automatically determine base pathIssue #2: Struct Field Access
File:
lib/phoenix_kit/users/oauth.exauth.credentials[:token]) with dot notation (auth.credentials.token)get_raw_info/1helper with pattern matchingImpact
Test Plan
Files Modified
lib/phoenix_kit/users/oauth_config.ex- base_path preservationlib/phoenix_kit/users/oauth.ex- struct field access fixesmix.exs- version bump to 1.4.7CHANGELOG.md- comprehensive documentation