Skip to content

Commit 5f8382e

Browse files
Merge pull request #7123 from mailcow/fix/7115
[Web] Fix LDAP/Keycloak login TypeError - missing JSON decode for attributes
2 parents 1e08501 + d1feebf commit 5f8382e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

data/web/inc/functions.auth.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ function user_login($user, $pass, $extra = null){
287287
return false;
288288
}
289289

290+
$row['attributes'] = json_decode($row['attributes'], true);
291+
290292
// check for tfa authenticators
291293
$authenticators = get_tfa($user);
292294
if (isset($authenticators['additional']) && is_array($authenticators['additional']) && count($authenticators['additional']) > 0 && !$is_internal) {
@@ -343,6 +345,8 @@ function user_login($user, $pass, $extra = null){
343345
return false;
344346
}
345347

348+
$row['attributes'] = json_decode($row['attributes'], true);
349+
346350
// check for tfa authenticators
347351
$authenticators = get_tfa($user);
348352
if (isset($authenticators['additional']) && is_array($authenticators['additional']) && count($authenticators['additional']) > 0 && !$is_internal) {

0 commit comments

Comments
 (0)