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

Set default secret length to 16 and split it into bits of 4 when displaying.

parent fe084d11
......@@ -208,7 +208,7 @@ class Wp_Otp_Admin {
*
* @param int $secret_length
*/
$secret_length = $secret_length_override ?: (int) apply_filters( 'wp_otp_secret_length', 8 );
$secret_length = $secret_length_override ?: (int) apply_filters( 'wp_otp_secret_length', 16 );
$secret_length = min( max( 8, $secret_length ), 64 );
return substr( Base32::encode( random_bytes( 42 ) ), 0, $secret_length );
......
......@@ -11,7 +11,7 @@
<table class="form-table">
<tr>
<th scope="row">
<?php echo __( 'OTP Secret', 'wp-otp' ) . ':<br>' . $secret . '<br><br>'; ?>
<?php echo __( 'OTP Secret', 'wp-otp' ) . ':<br>' . implode( ' ', str_split( $secret, 4 ) ) . '<br><br>'; ?>
<?php if ( $otp_enabled ): ?>
<?php
printf(
......
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