• Resolved teeboy4real

    (@teeboy4real)


    Can you add a feature to autogenerate Security Key Name to make the registration process simple and fast, I noticed that some of my users dont know what to name their security key

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter teeboy4real

    (@teeboy4real)

    maybe using random names like SKY-1 for the first user and SKY-2 for the second user registration

    Plugin Author Mohamed Endisha

    (@endisha)

    @teeboy4real

    Secure Passkeys does not currently include a dedicated hook or filter to modify the security key name, but you can achieve this by using a general WordPress filters.

    Security key name must be unique for the user, so we try to auto-generate one using the current date and time. You can still modify it afterward.

    Please note that only letters (A–Z, a–z), underscores (_), and hyphens (-) are allowed in the key name.

    add_filter('sanitize_text_field', function($filtered, $str){
    $action = _sanitize_text_fields($_POST['action'] ?? '', false);
    if($action == 'secure_passkeys_frontend_register_passkey'){
    $_POST['security_key_name'] = date('ymdHis');//250625083110
    }

    return $filtered;
    }, 100, 2);

    It may be added as a configurable option in the settings in a future release.

    Thread Starter teeboy4real

    (@teeboy4real)

    Thanks a lot the code worked perfectly

    Plugin Author Mohamed Endisha

    (@endisha)

    @teeboy4real

    Following your suggestion, auto-generating key names is now a built-in optional feature in version 1.1.0, which has now been released.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Auto generate Security Key Name’ is closed to new replies.