Repository navigation
feat(cli): init apns --reset signs in to Apple again - #1999
ArnabChatterjee20k merged 2 commits into
Conversation
A saved Apple sign-in was reused until Apple expired it, and the only way to sign in again, or as another Apple ID, was to delete a file by hand. --reset signs in from scratch, two-factor included, and the new session replaces the saved one. It implies --create-key, as signing in is only for creating a key, so it is not stopped by APNs being set up already, and it cannot be combined with --key-path or --key-id. apns.Request gains Reset. The appwrite setup loads none of the saved cookies, not even the one that marks the machine as trusted. The expo helper runs apple-utils' Auth.logoutAsync, which deletes its saved session for the Apple ID, and the fastlane lane deletes spaceship's saved session for the Apple ID before signing in.
🟢 Tier S · Ready to merge
Adds Latest changes: The latest commits make the Expo adapter ask for a missing Apple ID before starting a reset and pass it to the helper, with tests for prompted and already-provided IDs.
📂 Walkthrough · 11
Reviewed the commits since |
With --reset and no APPWRITE_APPLE_ID, the expo setup asked for the Apple ID twice: apple-utils' Auth.logoutAsync asks for it to find the session and forgets it, and the sign-in that follows asked again. The adapter now asks once and passes it as EXPO_APPLE_ID, which both read (resolveCredentialsAsync takes the given username, then EXPO_APPLE_ID, and prompts only without either).
e7cdbea
into
messaging-provider-cli-apns
Stacked on #1963. Adds
init apns --reset, so you can sign in to Apple again without deleting files by hand.Why
A saved Apple sign-in is reused until Apple expires it, about 30 days. Until now the only way to sign in again, or to switch to another Apple ID, was to delete
~/.appwrite/apns/<setup>/session.jsonby hand.What
APPWRITE_APPLE_ID/APPWRITE_APPLE_PASSWORDstill answer the first two. The new session replaces the saved one, so later runs reuse it.--create-key: signing in is only for creating a key. It doesn't stop at "APNs is already set up", and it can't be combined with--key-pathor--key-id.Signing in again: the saved Apple sign-in is not used (--reset).--resetdoesappwritesession.json.expoAuth.logoutAsync, which deletes its saved session for that Apple ID in~/.app-store/, before signing in.fastlanePortalClient#persistent_cookie_path, under~/.fastlane/spaceship/) beforeSpaceship::Portal.login.apns.RequestgainsReset bool, so each setup handles it in its own way.Tests
TestInitApnsResetSignsInAgainAndCreatesAKey: on an already set-up app,--resetalone (no--create-keyor--force) creates a key withRequest.Reset, writes it to the providers and logs the reset.--resetwith--key-pathis rejected.TestResetSignsInAgain(appwrite, fake Apple with real SRP):TestCreateKeyPassesResetToTheHelper(expo) andTestCreateKeyPassesResetToTheLane(fastlane): the flag reaches the helper and the lane.-race), gofmt, the WebAssembly browser build,GOOS=windows go vet,ruby -con the Fastfile andnode --checkon the helper all pass.