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

auth.sms.test_otp w/ international numbers #1566

Closed
franzwarning opened this issue Apr 29, 2024 · 6 comments · Fixed by #1567
Closed

auth.sms.test_otp w/ international numbers #1566

franzwarning opened this issue Apr 29, 2024 · 6 comments · Fixed by #1567
Labels
auth bug Something isn't working

Comments

@franzwarning
Copy link

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?

@franzwarning franzwarning added the bug Something isn't working label Apr 29, 2024
@encima
Copy link
Member

encima commented Apr 30, 2024

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)

@encima encima added the auth label Apr 30, 2024
@franzwarning
Copy link
Author

franzwarning commented Apr 30, 2024

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.

@kangmingtay kangmingtay transferred this issue from supabase/supabase Apr 30, 2024
@kangmingtay
Copy link
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)

@franzwarning
Copy link
Author

Thank you for the fast response!

kangmingtay added a commit that referenced this issue Apr 30, 2024
## What kind of change does this PR introduce?
* Apply basic formatting on test OTPs when config is loaded
* Fixes #1566

## What is the current behavior?

Please link any relevant issues here.

## What is the new behavior?

Feel free to include screenshots if it includes visual changes.

## Additional context

Add any other context or screenshots.
@choim4389
Copy link

choim4389 commented Jul 25, 2024

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?

@encima
Copy link
Member

encima commented Jul 29, 2024

@choim4389 wrap the phone number in quotes as well

uxodb pushed a commit to uxodb/auth that referenced this issue Nov 13, 2024
## What kind of change does this PR introduce?
* Apply basic formatting on test OTPs when config is loaded
* Fixes supabase#1566

## What is the current behavior?

Please link any relevant issues here.

## What is the new behavior?

Feel free to include screenshots if it includes visual changes.

## Additional context

Add any other context or screenshots.
LashaJini pushed a commit to LashaJini/auth that referenced this issue Nov 13, 2024
## What kind of change does this PR introduce?
* Apply basic formatting on test OTPs when config is loaded
* Fixes supabase#1566

## What is the current behavior?

Please link any relevant issues here.

## What is the new behavior?

Feel free to include screenshots if it includes visual changes.

## Additional context

Add any other context or screenshots.
LashaJini pushed a commit to LashaJini/auth that referenced this issue Nov 15, 2024
## What kind of change does this PR introduce?
* Apply basic formatting on test OTPs when config is loaded
* Fixes supabase#1566

## What is the current behavior?

Please link any relevant issues here.

## What is the new behavior?

Feel free to include screenshots if it includes visual changes.

## Additional context

Add any other context or screenshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants