Skip to content

Commit

Permalink
Add two_factor_totp_title filter to allow TOTP title to be changed by…
Browse files Browse the repository at this point in the history
… site-owner (#294)

Props @BrookeDot
  • Loading branch information
BrookeDot authored and kasparsd committed May 8, 2019
1 parent 63de5fc commit c244adb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion providers/class.two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ public function user_two_factor_options( $user ) {
<?php if ( empty( $key ) ) :
$key = $this->generate_key();
$site_name = get_bloginfo( 'name', 'display' );
$totp_title = apply_filters( 'two_factor_totp_title', $site_name . ':' . $user->user_login, $user );
?>
<p>
<?php esc_html_e( 'Please scan the QR code or manually enter the key, then enter an authentication code from your app in order to complete setup.', 'two-factor' ); ?>
</p>
<p>
<img src="<?php echo esc_url( $this->get_google_qr_code( $site_name . ':' . $user->user_login, $key, $site_name ) ); ?>" id="two-factor-totp-qrcode" />
<img src="<?php echo esc_url( $this->get_google_qr_code( $totp_title, $key, $site_name ) ); ?>" id="two-factor-totp-qrcode" />
</p>
<p>
<code><?php echo esc_html( $key ); ?></code>
Expand Down

0 comments on commit c244adb

Please sign in to comment.