feat(enchantedlink): add SMS delivery support - #1690
Conversation
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
|
@shuni review |
🐕 Shuni ReviewAdds 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: Review scope: Full review Reviewed files (12)
🐕 Review complete — View session on Shuni Portal 🐾 🤖 Model: |
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)descope/authmethod/enchantedlink.py
descope/authmethod/enchantedlink_async.py
descope/authmethod/_enchantedlink_base.py
descope/common.py
|
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
|
@shuni review |
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.
Adds Enchanted Link over SMS to the python-sdk, sync and async.
*_with_phonemethods on the enchanted link client.revokeOtherSessionsbeing 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