Verified Commit a85fb4a8 authored by noplanman's avatar noplanman
Browse files

Set issuer to be the name of the site.

parent 432fe4e2
......@@ -40,7 +40,6 @@ class Wp_Otp_Admin {
$user->user_login,
$user_meta_data->get_user_meta( 'secret' )
);
$otp->setIssuer( get_option( 'blogname' ) );
$secret = $otp->getSecret();
$user_meta_data->set_user_meta( 'secret', $secret );
......@@ -111,6 +110,8 @@ class Wp_Otp_Admin {
$secret = $user_meta_data->get_user_meta( 'secret' );
$otp = new TOTP( $user->user_login, $secret );
// Issuer isn't allowed to have any semicolon.
$otp->setIssuer( str_replace( [ ':', '%3a', '%3A' ], '', get_bloginfo( 'name' ) ) );
// Check if the secret was loaded from the meta or not.
if ( null === $secret ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment