-
-
Notifications
You must be signed in to change notification settings - Fork 183
feat(auth): implement linkIdentity with OIDC #776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
grdsdev
merged 10 commits into
main
from
guilherme/clibs-283-supabase-swift-implement-linkidentity-with-oidc
Sep 15, 2025
Merged
feat(auth): implement linkIdentity with OIDC #776
grdsdev
merged 10 commits into
main
from
guilherme/clibs-283-supabase-swift-implement-linkidentity-with-oidc
Sep 15, 2025
+244
−75
Conversation
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
Pull Request Test Coverage Report for Build 17051035318Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
- Add linkIdentityWithIdToken method to AuthClient - Refactor signInWithIdToken to support identity linking - Add linkIdentity property to OpenIDConnectCredentials - Improve code formatting consistency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove private _signInWithIdToken helper method - Inline the implementation directly in linkIdentityWithIdToken - Update test to include Authorization header in expected request - Add session storage setup for linkIdentityWithIdToken test
da36f30
to
53609c6
Compare
- Add event monitoring to verify userUpdated event is triggered - Assert correct event sequence: [.initialSession, .userUpdated] - Verify session state is properly updated - Follow consistent testing pattern with other auth tests
- Add assertAuthStateChanges convenience methods to reduce code duplication - Support both action-based and post-action event assertion patterns - Refactor testSignOut, testSignInAnonymously, and testLinkIdentityWithIdToken to use new methods - Improve test readability and maintainability - Reduce boilerplate code in auth state change tests
- Remove expectedEventCount parameter from convenience methods - Use expectedEvents.count to determine number of events to collect - Reduces API surface and eliminates redundant parameter - Makes the methods more intuitive and less error-prone
- Refactor testLinkIdentityWithIdToken to use action-based assertAuthStateChanges - Add proper error location tracking with fileID, filePath, line, and column parameters - Remove unused post-action assertAuthStateChanges method - Improve test structure by combining action execution with event assertion - Fix indentation in commented testGenerateLink_signUp test
- Replace _signIn helper with direct api.execute call - Add explicit session manager update after successful API call - Add explicit eventEmitter.emit(.userUpdated) for proper event handling - Ensure consistent behavior with other identity linking methods - Improve code clarity by removing unnecessary abstraction layer
mandarini
approved these changes
Sep 15, 2025
supabase-releaser bot
pushed a commit
that referenced
this pull request
Sep 15, 2025
## [2.32.0](v2.31.2...v2.32.0) (2025-09-15) ### Features * **auth:** implement linkIdentity with OIDC ([#776](#776)) ([661e321](661e321))
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.
What kind of change does this PR introduce?
Feature - implements identity linking functionality using OpenID Connect credentials.
What is the current behavior?
Currently, the Swift Auth client only supports signing in with OIDC credentials but doesn't provide a way to link additional identities to an existing user account using OIDC.
What is the new behavior?
linkIdentityWithIdToken
method toAuthClient
that allows linking an OIDC identity to the current usersignInWithIdToken
method to support both sign-in and identity linking flows through an internal_signInWithIdToken
helperlinkIdentity
property toOpenIDConnectCredentials
to distinguish between sign-in and linking operationsThe new method follows the same pattern as other identity linking methods in the client.
Additional context
This implements the OIDC identity linking functionality referenced in the branch name (clibs-283). The implementation maintains backward compatibility while adding the new linking capability.
Close #588
🤖 Generated with Claude Code