]> git.joonet.de Git - adminer.git/commitdiff
AdminerLoginOtp: Autocomplete hints for OTP input field, code refactoring
authorPeter Knut <peter@pematon.com>
Fri, 6 Sep 2024 21:31:04 +0000 (23:31 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:37 +0000 (11:16 +0100)
Tanks to SGCBB (https://github.com/vrana/adminer/pull/488)

plugins/login-otp.php

index 0460eed344eaa904e8bef12bfe205819103128c8..f2e55f6e293d80f9fb0a19263c2391ceac7b28b1 100644 (file)
@@ -24,7 +24,7 @@ class AdminerLoginOtp {
                if ($name == 'password') {
                        return $heading . $value
                                . "<tr><th><acronym title='One Time Password' lang='en'>OTP</acronym>"
-                               . "<td><input type='number' name='auth[otp]' value='" . h($_SESSION["otp"]) . "' size='6' autocomplete='off'>\n"
+                               . "<td><input type='number' name='auth[otp]' value='" . h($_SESSION["otp"]) . "' size='6' autocomplete='one-time-code' inputmode='numeric' maxlength='6' pattern='\d{6}'>\n"
                        ;
                }
        }