Skip to content

Commit

Permalink
Fix. Auth. Logout. Browser sign gathering from user meta is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandergull committed Aug 5, 2024
1 parent de20a91 commit eeec685
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions inc/spbc-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,21 +289,22 @@ function spbc_authenticate__browser_sign__get($user)
*
* @param $user
*
* @return bool|string Browser sign
* @return string Browser sign
*/
function spbc_authenticate__browser_sign__get_hash($user)
{
$sign_collection = get_user_meta($user->ID, 'spbc_browser_sign', true);
if (! is_array($sign_collection)) {
return $sign_collection;

if (is_scalar($sign_collection)) {
return (string)$sign_collection;
}

$sign = '';
foreach ($sign_collection as $item) {
$sign .= $item;
if (is_array($sign_collection)) {
$sign = implode('', $sign_collection);
return md5($sign);
}

return md5($sign);
return '';
}


Expand Down Expand Up @@ -670,7 +671,7 @@ function spbc_wp_logout($id)
'event' => 'logout',
'roles' => $roles,
'user_agent' => spbc_authenticate__user_agent__get($user),
'browser_sign' => spbc_authenticate__browser_sign__get($user),
'browser_sign' => spbc_authenticate__browser_sign__get_hash($user),
)
);
}
Expand Down

0 comments on commit eeec685

Please sign in to comment.