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.
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With