Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: passwordless SMS and expiry notice in code / link templates #4104

Merged
merged 18 commits into from
Oct 4, 2024

Conversation

aeneasr
Copy link
Member

@aeneasr aeneasr commented Sep 16, 2024

This feature allows Ory Kratos to use the SMS gateway for login and registration with code via SMS.

Additionally, the default email and sms templates have been updated. We now also expose ExpiresInMinutes / expires_in_minutes in the templates, making it easier to remind the user how long the code or link is valid for.

Related issue(s)

Closes #1570
Closes #3779

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

  • Add e2e tests

@aeneasr aeneasr self-assigned this Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 70.45455% with 26 lines in your changes missing coverage. Please review.

Project coverage is 78.58%. Comparing base (ad1acd5) to head (25b6bf0).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
selfservice/strategy/code/code_sender.go 57.69% 10 Missing and 1 partial ⚠️
courier/courier_dispatcher.go 75.00% 4 Missing and 2 partials ⚠️
courier/sms_templates.go 0.00% 5 Missing ⚠️
courier/template/sms/registration_code_valid.go 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4104      +/-   ##
==========================================
- Coverage   78.60%   78.58%   -0.03%     
==========================================
  Files         377      378       +1     
  Lines       26914    26966      +52     
==========================================
+ Hits        21156    21190      +34     
- Misses       4148     4166      +18     
  Partials     1610     1610              
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aeneasr aeneasr added the feat New feature or request. label Sep 20, 2024
@eddmann
Copy link

eddmann commented Sep 23, 2024

Hey 👋🏻 , thanks for all the great work you do on Ory.

I am very interested in this feature, providing the ability to support a passwordless login based on an SMS OTP. Just wondering would the flow for this authentication method be for the user to provide their phone number and then based on that identifier being present in the database it will send an SMS code to the phone number? Similar to how the Email OTP works?

@aeneasr
Copy link
Member Author

aeneasr commented Sep 23, 2024

The feature behaves the same, it's just supporting another notification channel now.

@eddmann
Copy link

eddmann commented Sep 24, 2024

Great, apologies for another question. To expand upon this will the user supply their email address or phone number and based on that send the login code to the relevant notification channel?

For example, sending the following request would send an email notification:

<input name="identifier" value={emailAddress} />

And sending the following request would send an SMS notification, providing the phone number is an identifier?

<input name="identifier" value={phoneNumber} />

or can we supply the email address as the identifier but send an SMS OTP instead, perhaps with an additional parameter?

<input name="channel" value="phone|email" />

test/e2e/mock/httptarget/main.go Dismissed Show dismissed Hide dismissed
@aeneasr aeneasr changed the title feat: allow SMS as passwordless login and signup method feat: passwordless SMS and expiry notice in code / link templates Oct 4, 2024
@aeneasr aeneasr merged commit 462cea9 into master Oct 4, 2024
30 of 31 checks passed
@aeneasr aeneasr deleted the add-missing-templates branch October 4, 2024 10:00
@eddmann
Copy link

eddmann commented Oct 15, 2024

Thank you for working on this new behaviour, just wondering if there is an ETA for a new release to be made which includes this new feature? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support OTP login with SMS Passwordless SMS code authentication
3 participants