Skip to content

feat(enchantedlink): add SMS delivery support - #1690

Open
eliran-descope wants to merge 5 commits into
mainfrom
feature/el-sms-sdks
Open

feat(enchantedlink): add SMS delivery support#1690
eliran-descope wants to merge 5 commits into
mainfrom
feature/el-sms-sdks

Conversation

@eliran-descope

@eliran-descope eliran-descope commented Sep 9, 2026

Copy link
Copy Markdown

Adds Enchanted Link over SMS to the python-sdk, sync and async.

  • Four new *_with_phone methods on the enchanted link client.
  • Additive only. Existing email methods unchanged.
  • Also fixes revokeOtherSessions being dropped on every sign-up-or-in (enchantedlink, magiclink, otp) — pre-existing, fixed so phone and email behave the same.

Part of descope/etc#18315

Eliran Kononowicz and others added 2 commits September 8, 2026 12:46
Add sign_in_with_phone/sign_up_with_phone/sign_up_or_in_with_phone as
new, additive methods on EnchantedLink/EnchantedLinkAsync that route to
the new /sms backend endpoints. Existing sign_in/sign_up/sign_up_or_in
keep their original signatures and email-only behavior unchanged.

The private URL/body composers in _enchantedlink_base.py take a
DeliveryMethod so both the email and phone paths share the same
plumbing; adjust_and_verify_delivery_method (in _auth_base.py) already
handled non-email methods generically, so no changes were needed there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 2f2d231)
…delivery

Completes Enchanted Link SMS support: adds the update_user_phone_enchantedlink_path
route constant, the _compose_update_phone_url and _compose_update_user_phone_body
helpers, and update_user_phone on both the sync and async classes. Also documents
the phone variants in the README, whose Enchanted Link section still described the
link as email-only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tygd97fhsqkojmDTnr1aVj
@eliran-descope

Copy link
Copy Markdown
Author

@shuni review

@shuni-bot

shuni-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🐕 Shuni Review

Adds SMS enchanted-link support to both clients and preserves session-revocation options across signup-or-in flows.

Actionable comments posted: 0

Merge risk: 🟢 Low: The previously reported revocation defect is fixed; no actionable issues remain after review.

🤖 Model: gpt-6-astra


Review scope: Full review

Reviewed files (12)
  • README.md
  • descope/authmethod/_enchantedlink_base.py
  • descope/authmethod/enchantedlink.py
  • descope/authmethod/enchantedlink_async.py
  • descope/authmethod/magiclink.py
  • descope/authmethod/magiclink_async.py
  • descope/authmethod/otp.py
  • descope/authmethod/otp_async.py
  • descope/common.py
  • tests/test_enchantedlink.py
  • tests/test_magiclink.py
  • tests/test_otp.py

🐕 Review complete — View session on Shuni Portal 🐾

🤖 Model: gpt-6-astra

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Coverage report

The coverage rate went from 98.26% to 98.3% ⬆️

94.5% of new lines are covered.

Diff Coverage details (click to unfold)

descope/authmethod/enchantedlink.py

97.14% of new lines are covered (97.46% of the complete file).
Missing lines: 80

descope/authmethod/enchantedlink_async.py

97.14% of new lines are covered (97.43% of the complete file).
Missing lines: 86

descope/authmethod/_enchantedlink_base.py

85% of new lines are covered (89.06% of the complete file).
Missing lines: 127, 129, 131

descope/common.py

100% of new lines are covered (100% of the complete file).

Comment thread descope/authmethod/enchantedlink.py
eliran-descope and others added 2 commits September 9, 2026 12:01
sign_up_or_in_with_phone built its LoginOptions without
revoke_other_sessions, so the option was silently dropped. Passed it
through in both the sync and async clients.

The email variant sign_up_or_in has the same gap on main, as do the
magiclink and otp sign_up_or_in methods; those are left untouched here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tygd97fhsqkojmDTnr1aVj
SignUpOptions.revokeOtherSessions was dropped when composing LoginOptions
for the email sign-up-or-in flows in enchantedlink, magiclink and otp, in
both the sync and async clients, so callers setting it got no effect. The
phone variant was fixed separately; this brings the remaining sites into
line so behaviour no longer differs by delivery method.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tygd97fhsqkojmDTnr1aVj
@eliran-descope

Copy link
Copy Markdown
Author

@shuni review

@eliran-descope
eliran-descope marked this pull request as ready for review September 10, 2026 10:40
@eliran-descope
eliran-descope marked this pull request as draft September 10, 2026 11:04
@eliran-descope
eliran-descope requested review from asafshen and removed request for asafshen September 10, 2026 11:04
The enchanted link intro was widened to mention the phone variants while
still claiming the message carries three links. Over SMS only the correct
link is sent, so the intro now covers email alone and the SMS paragraph
states that there is nothing for the user to choose.
@eliran-descope
eliran-descope marked this pull request as ready for review September 10, 2026 11:46
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