Uh oh!
There was an error while loading. Please reload this page.
Fix critical OAuth and IPv6 handling issues - #134
Merged
Conversation
## Problem #1: OAuth halt() missing (CRITICAL) Fixed missing halt(conn) call in handle_oauth_request() that caused 500 errors when users clicked OAuth sign-in buttons. Phoenix would attempt to render a non-existent view template after Ueberauth processed the request. Modified: lib/phoenix_kit_web/users/oauth.ex:105 ## Problem #2: IPv6 Protocol.UndefinedError (HIGH PRIORITY) Created centralized PhoenixKit.Utils.IpAddress module to prevent Protocol.UndefinedError when extracting IPv6 addresses. Root cause: Six files had duplicate extract_ip_address() functions calling to_string(address) on IPv6 tuples without proper guard clauses. This caused: Protocol.UndefinedError: String.Chars not implemented for IPv6 tuples Solution: - Created lib/phoenix_kit/utils/ip_address.ex with proper pattern matching: * IPv4: {a, b, c, d} pattern with is_integer guards * IPv6: {a, b, c, d, e, f, g, h} pattern with is_integer guards * Invalid/nil: returns "unknown" - Removed duplicate implementations from 7 files: * lib/phoenix_kit_web/live/dashboard.ex * lib/phoenix_kit_web/users/login.ex * lib/phoenix_kit_web/users/registration.ex * lib/phoenix_kit_web/users/magic_link.ex * lib/phoenix_kit_web/live/users/live_sessions.ex * lib/phoenix_kit/utils/geolocation.ex * lib/phoenix_kit_web/users/oauth.ex - Updated all call sites to use IpAddress.extract_from_socket() or IpAddress.extract_from_conn() for consistency ## Problem #3: OAuth config not loading at startup Already fixed in current version (integration.ex:442-463). phoenix_kit_routes() macro spawns task that calls OAuthConfig.configure_providers() with 100ms delay to ensure database is ready. ## Code Quality - Fixed all Credo compilation warnings (alias ordering, number formatting) - Comprehensive unit tests added (17 test cases covering IPv4, IPv6, edge cases) - All tests passing - No compilation errors or warnings
## Added to 1.4.5 Changelog - OAuth halt() missing in request handler fix - IPv6 Protocol.UndefinedError resolution with centralized IpAddress module - Google OAuth credentials auto-reload after save - OAuth error message improvements (user-friendly field names) - AWS credentials verification simplification - Settings error diagnostics improvements - AWS SES v2 infrastructure fixes ## Details - Date updated: 2025-10-26 - 5 commits included in release - All critical OAuth and IPv6 issues documented - AWS infrastructure improvements documented - Full upgrade notes and technical details included
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 freeto 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
Changes
Problem #1: OAuth halt() missing (CRITICAL)
Problem #2: IPv6 Protocol.UndefinedError (HIGH PRIORITY)
Problem #3: OAuth config not loading at startup
Test Plan