gSystemWebauthnAjaxLogin::class; break; case 'onAjaxWebauthnSavelabel': $eventClass = PlgSystemWebauthnAjaxSaveLabel::class; break; default: $eventClass = GenericEvent::class; break; } $triggerEvent = new $eventClass($eventName, []); $result = $this->getApplication()->getDispatcher()->dispatch($eventName, $triggerEvent); $results = ($result instanceof ResultAwareInterface) ? ($result['result'] ?? []) : []; $result = array_reduce( $results, function ($carry, $result) { return $carry ?? $result; }, null ); } catch (\Exception $e) { Log::add("Callback failure, redirecting to $returnURL.", Log::DEBUG, 'webauthn.system'); $this->getApplication()->getSession()->set('plg_system_webauthn.returnUrl', null); $this->getApplication()->enqueueMessage($e->getMessage(), 'error'); $this->getApplication()->redirect($returnURL); return; } if (!\is_null($result)) { switch ($input->getCmd('encoding', 'json')) { case 'raw': Log::add("Callback complete, returning raw response.", Log::DEBUG, 'webauthn.system'); echo $result; break; case 'redirect': $modifiers = ''; if (isset($result['message'])) { $type = $result['type'] ?? 'info'; $this->getApplication()->enqueueMessage($result['message'], $type); $modifiers = " and setting a system message of type $type"; } if (isset($result['url'])) { Log::add("Callback complete, performing redirection to {$result['url']}{$modifiers}.", Log::DEBUG, 'webauthn.system'); $this->getApplication()->redirect($result['url']); } Log::add("Callback complete, performing redirection to {$result}{$modifiers}.", Log::DEBUG, 'webauthn.system'); $this->getApplication()->redirect($result); return; default: Log::add("Callback complete, returning JSON.", Log::DEBUG, 'webauthn.system'); echo json_encode($result); break; } $this->getApplication()->close(200); } Log::add("Null response from AJAX callback, redirecting to $returnURL", Log::DEBUG, 'webauthn.system'); $this->getApplication()->getSession()->set('plg_system_webauthn.returnUrl', null); $this->getApplication()->redirect($returnURL); } } An Error Occurred: Whoops, looks like something went wrong.

Sorry, there was a problem we could not recover from.

The server returned a "500 - Whoops, looks like something went wrong."

Help me resolve this