Skip to content

feat(login): add --local for OTP delivery via the instance response#73

Merged
Bccorb merged 1 commit into
mainfrom
feat/login-local-delivery
Jul 21, 2026
Merged

feat(login): add --local for OTP delivery via the instance response#73
Bccorb merged 1 commit into
mainfrom
feat/login-local-delivery

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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 --local closes 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

  • Gated to local hosts. Running --local against a remote instance is rejected with a clear message.
  • Requires the auth API to run outside production with 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.
  • Falls back to the normal code prompt if no code is auto-filled (for example on a resend).

Usage

Server (auth API), non-production:

ALLOW_UNCREDENTIALED_DELIVERY_SECRETS=true npm run dev

CLI (profile pointed at a local instance):

seamless login you@example.com --local

Notes

Testing

  • npm run build: clean
  • npm test: 588 passed, 4 skipped
  • Added unit and command tests covering the external-delivery header, auto-fill, the missing-code error, and the non-local guard.

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.
@Bccorb
Bccorb merged commit e41ae69 into main Jul 21, 2026
1 check failed
@Bccorb
Bccorb deleted the feat/login-local-delivery branch July 21, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant