public function acs()
{
$errors = $this->saml2Auth->acs();
if (!empty($errors)) {
logger()->error('Saml2 error', $errors);
session()->flash('saml2_error', $errors);
return redirect(config('saml2_settings.errorRoute'));
}
$user = $this->saml2Auth->getSaml2User();
event(new Saml2LoginEvent($user));
$redirectUrl = $user->getIntendedUrl();
if ($redirectUrl !== null) {
return redirect($redirectUrl);
} else {
return redirect(config('saml2_settings.loginRoute'));
}
}