fix(OCM-invites): Use the correct way of getting the email

It seems primary email can sometimes be empty, even if the user has an email set.

Signed-off-by: Micke Nordin <kano@sunet.se>
This commit is contained in:
Micke Nordin 2025-06-12 17:00:13 +02:00
parent b49065fc9d
commit 4d4b886607
No known key found for this signature in database
GPG key ID: 0DA0A7A5708FE257

View file

@ -271,7 +271,7 @@ class RequestHandlerController extends Controller {
$response->throttle();
return $response;
}
if ($invitation->isAccepted() === true) {
$response = ['message' => 'Invite already accepted', 'error' => true];
$status = Http::STATUS_CONFLICT;
@ -291,8 +291,8 @@ class RequestHandlerController extends Controller {
$response->throttle();
return $response;
}
$sharedFromEmail = $localUser->getPrimaryEMailAddress();
$sharedFromEmail = $localUser->getEMailAddress();
if ($sharedFromEmail === null) {
$response = ['message' => 'Invalid or non existing token', 'error' => true];
$status = Http::STATUS_BAD_REQUEST;