From 2448a3df0bb510410af9540d0d05c96318f6de38 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 9 Apr 2021 23:31:28 +0200 Subject: [PATCH] Fix: Get nami user --- src/NamiUserProvider.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/NamiUserProvider.php b/src/NamiUserProvider.php index 181eda2..8fd822a 100644 --- a/src/NamiUserProvider.php +++ b/src/NamiUserProvider.php @@ -34,12 +34,17 @@ class NamiUserProvider implements UserProvider { try { $api = $user->attemptNamiLogin($credentials['password']); - $data = collect($api->allMembers()->data)->first(function($member) use ($credentials) { - return $member->entries_mitgliedsNummer == $credentials['mglnr']; + $group = $api->group($credentials['groupid']); + $data = $group->memberOverview()->first(function($member) use ($credentials) { + return $member->mitgliedsnr == $credentials['mglnr']; }); + + if (!$data) { + return false; + } Cache::forever('member.'.$credentials['mglnr'], [ - 'data' => $api->getMember($data->id)->data, + 'data' => $data, 'credentials' => $credentials ]);