feat(macos): sign in with Apple - #216
Draft
sebil wants to merge 2 commits into
Draft
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
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.
Adds Sign in with Apple as a second sign-in option, behind a small provider abstraction so more providers can plug in later without reworking the flow, identity, or UI.
What's in here
AuthProvider.swift):AuthProviderKind(.github/.apple) +AuthProfile, the single shape every provider returns (stable id, display name, optional avatar). No token is kept, same as before.authProvider+providerUserIDreplace the hard-wiredgithubLoginas the "signed in" signal. Existing GitHub installs migrate automatically (a storedgithubLoginreads as GitHub), and the legacy field is kept in sync.completeLogin/applyProfile. GitHub keeps its device-flow; Apple is a single asyncASAuthorizationControllercall. The flow state is generalized (AuthFlowState), Retry re-runs the last provider.AppleSignIn.swift): native sheet, stable user id, first-authorization-only name handled by caching it per user id (Apple won't return it again). No avatar — the initials fallback covers it.Munkel.entitlementswithcom.apple.developer.applesignin, wired into the real-identity codesign path inmake-bundle.sh.Not done / needs a real signing setup
Sign in with Apple only works with a real Apple Developer team identity, an App ID that has the capability enabled, and (for distribution) a provisioning profile. The ad-hoc dev build can't honor the entitlement, so the Apple sheet can't complete locally — I could not click-test the Apple path end to end. GitHub sign-in is unchanged and still works on the dev build. This stays a draft until we can verify Apple on a provisioned build.
Open follow-ups worth a look before marking ready:
SignInWithAppleButtonrather than a plain button.getCredentialStateon launch to react to a revoked Apple credential.Closes #215