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

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.