Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AutoFill code from OTP SMS in the input field HTML for example in Safari

Tags:

html

How can I set up auto-complete code from OTP SMS in Safari at the time of Captive Portal for Hotspot Mikrotik?

The problem is that a person does not have time to remember the 6-digit OTP code from SMS, then exit the Captive Portal, see the code in iMessage and then re-tries to log in to the Wi-Fi network, but the old session is already "rotten" and he again needs to enter the phone number and send the OTP SMS code

In HTML I wrote <input type="tel" id="single-factor-code-text-field" name="password" autocomplete="one-time-code" autofocus>, and in SMS I send <#> Your SMS-code: {$code}, but no magic happens.

like image 918
I P Avatar asked Jul 04 '19 04:07

I P


People also ask

How can I get OTP by SMS?

Android 11 and later versions: Tap Copy <OTP> in the SMS notification then tap on the input field > OTP displayed above the keyboard. Android 10 and prior versions: Open the SMS notification and copy OTP. Tap on the input field > OTP displayed above the keyboard.


1 Answers

I think I have found a solution to your problem. According to these docs, such an sms should have the following markup:

In the following origin-bound one-time code message, the host is "example.com", the code is "747723", and the explanatory text is "747723 is your ExampleCo authentication code.\n\n".

"747723 is your ExampleCo authentication code.

@example.com #747723"

After testing that worked for me. So in order to make the 'magic' happen, the message you are sending should look like this:

{$code} is your wi-fi login code.

@yourwebsite.com #{$code}

Hope this can help you or someone in the future!

like image 86
Chiel Avatar answered Nov 15 '22 06:11

Chiel