feat(login): add --local for OTP delivery via the instance response#73
Merged
Conversation
Local and self-hosted instances without a real mail or SMS provider could not complete OTP login, since the code was never surfaced. --local asks the instance for external delivery, reads the code from the response, and verifies with it automatically. It is gated to local hosts and requires the auth API to run outside production with ALLOW_UNCREDENTIALED_DELIVERY_SECRETS=true.
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
Local and self-hosted instances without a real mail or SMS provider could not complete OTP login through the CLI: the code was generated and stored only as a hash, never surfaced anywhere.
seamless login --localcloses that gap.With
--local, the CLI asks the instance for external delivery (x-seamless-auth-delivery-mode: external), reads the OTP back from the response, and verifies with it automatically. No prompt, no real email or SMS needed.Behavior
--localagainst a remote instance is rejected with a clear message.ALLOW_UNCREDENTIALED_DELIVERY_SECRETS=true. If the instance does not return a code, the CLI fails with an actionable error naming that flag rather than silently prompting.Usage
Server (auth API), non-production:
CLI (profile pointed at a local instance):
Notes
delivery.tokenresponse field already ship. This is CLI-side only.--localskips the prompt entirely.Testing
npm run build: cleannpm test: 588 passed, 4 skipped