Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow TOTP keys to be filterable #545

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ public function user_two_factor_options( $user ) {
* @return string
*/
public function get_user_totp_key( $user_id ) {
return (string) get_user_meta( $user_id, self::SECRET_META_KEY, true );
$meta = (string) get_user_meta( $user_id, self::SECRET_META_KEY, true );
return apply_filters( 'two_factor_totp_get_user_totp_key', $meta, $user_id );
}

/**
Expand All @@ -432,6 +433,7 @@ public function get_user_totp_key( $user_id ) {
* @return boolean If the key was stored successfully.
*/
public function set_user_totp_key( $user_id, $key ) {
$key = apply_filters( 'two_factor_totp_set_user_totp_key', $key, $user_id );
return update_user_meta( $user_id, self::SECRET_META_KEY, $key );
}

Expand Down