Skip to content

auth.sms.test_otp w/ international numbers #1566

Closed

Description

@franzwarning

Hi! I'm trying to use test_otp codes via signInWithOtp for international phone numbers, but it doesn't seem to work when I have a number that is prefixed with +1.... Has anyone else seen this behaviour?

Activity

  1. added
    bug
    on Apr 29, 2024
  2. encima commented on Apr 30, 2024

    @encima
    Member

    Hi @franzwarning
    thanks for opening. We would need some more information here please.

    I cannot reproduce your issue and the international format is supported (docs)

  3. franzwarning commented on Apr 30, 2024

    @franzwarning
    Author

    To reproduce:

    supabaseClient.auth.signInWithOtp({
        phone: '+19998887777',
    })
    

    w/ a config.toml

    [auth.sms.test_otp]
    "+19998887777" = "111111"
    

    It will try to use the provider instead of using the test_otp code.

    However, if you use a non-international number (just 9998887777), everything works.

  4. kangmingtay commented on Apr 30, 2024

    @kangmingtay
    Member

    hey @franzwarning, thanks for reporting this, we've made a fix for it - the issue is due to the auth service not applying the same basic formatting rules for the test OTPs in the config but it does not affect the SMS delivery to the underlying provider used (the country code will be respected)

  5. franzwarning commented on Apr 30, 2024

    @franzwarning
    Author

    Thank you for the fast response!

  6. added a commit that references this issue on Apr 30, 2024
    434a59a
  7. choim4389 commented on Jul 25, 2024

    @choim4389

    I facing error (last key "auth.sms.test_otp"): expected '.' or '=', but got '+' instead when try to set test_otp in config.toml for local development.

    [auth.sms.test_otp]
    +821012341234 = "012345"
    

    how to set international number as test number?

  8. encima commented on Jul 29, 2024

    @encima
    Member

    @choim4389 wrap the phone number in quotes as well

  9. added a commit that references this issue on Nov 13, 2024
    2209046
  10. added 2 commits that reference this issue on Nov 13, 2024
    523d695
    ddaec54
  11. added a commit that references this issue on Aug 7, 2025
    7e31d23
  12. added a commit that references this issue on Sep 27, 2025
    a021129
  13. added a commit that references this issue on Sep 30, 2025
    0738072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions