Skip to content

Commit

Permalink
Update function names per WordPress/wporg-mu-plugins#390
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored Apr 18, 2023
1 parent 3d89b20 commit 96cab4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions class-encrypted-totp-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function get_key() {
* @return bool True if the key was saved, false otherwise.
*/
public function set_user_totp_key( $user_id, $key ) {
if ( function_exists( 'wporg_authenticated_encrypt' ) ) {
$key = wporg_authenticated_encrypt( $key, (string) $user_id, 'two-factor' );
if ( function_exists( 'wporg_encrypt' ) ) {
$key = wporg_encrypt( $key, (string) $user_id, 'two-factor' );
}

return parent::set_user_totp_key( $user_id, (string) $key );
Expand All @@ -41,7 +41,7 @@ public function get_user_totp_key( $user_id ) {

if ( $key && function_exists( 'wporg_is_encrypted' ) ) {
if ( wporg_is_encrypted( $key ) ) {
$key = (string) wporg_authenticated_decrypt( $key, (string) $user_id, 'two-factor' );
$key = (string) wporg_decrypt( $key, (string) $user_id, 'two-factor' );
} else {
// Upgrade the key to be encrypted.
$this->set_user_totp_key( $user_id, $key );
Expand Down

0 comments on commit 96cab4d

Please sign in to comment.