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

Automatic OTP code retrieval from transport? #58

Open
shaun-fitzgibbon opened this issue Jul 15, 2024 · 4 comments
Open

Automatic OTP code retrieval from transport? #58

shaun-fitzgibbon opened this issue Jul 15, 2024 · 4 comments

Comments

@shaun-fitzgibbon
Copy link

Automatic OTP code retrieval from transport?

Does this mean you have to click the sms when it appears at the bottom on your mobile to enter it into your OTP input or that when you receive the sms it will retrieve the pin automatically and enter it in your input with out user interaction ?

Im looking get the functionality that it will retrieve the code automatically like some sites do so the user does not need to do anything on mobile

@shaun-fitzgibbon
Copy link
Author

my understanding from the wording here is it should work without user interaction but I cannot get it to do this
is there some setup I need to configure ?

@guilhermerodz
Copy link
Owner

@shaun-fitzgibbon you can actually do this by applying the HTML property autocomplete="one-time-code", but you can also implement the WebOTP API

Perhaps this could turn into an official feature of input-otp in the future.

@shaun-fitzgibbon
Copy link
Author

Thanks for the response @guilhermerodz much appreciated.
I was under the impression that by default the autocomplete="one-time-code" is already set using input-otp ?

Screen Shot 2024-08-04 at 14 06 30 PM

@guilhermerodz
Copy link
Owner

Thanks for the response @guilhermerodz much appreciated. I was under the impression that by default the autocomplete="one-time-code" is already set using input-otp ?

Screen Shot 2024-08-04 at 14 06 30 PM

Its default is autocomplete='one-time-code' indeed. However, I'm not sure what behavior you are trying to achieve. If you want to work with WebOTP API, that's not included in input-otp by default.

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

No branches or pull requests

2 participants