namespace BookStack\Auth\Access\Oidc;
+use function auth;
use BookStack\Auth\Access\LoginService;
use BookStack\Auth\Access\RegistrationService;
use BookStack\Auth\User;
use BookStack\Exceptions\JsonDebugException;
use BookStack\Exceptions\StoppedAuthenticationException;
use BookStack\Exceptions\UserRegistrationException;
+use function config;
use Illuminate\Support\Facades\Cache;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use Psr\Http\Client\ClientInterface as HttpClient;
-use function auth;
-use function config;
use function trans;
use function url;
/**
* Initiate an authorization flow.
*
- * @return array{url: string, state: string}
* @throws OidcException
+ *
+ * @return array{url: string, state: string}
*/
public function login(): array
{
return $this->processAccessTokenCallback($accessToken, $settings);
}
-
/**
* @throws OidcException
*/
namespace BookStack\Http\Controllers\Auth;
-use BookStack\Auth\Access\Oidc\OidcService;
use BookStack\Auth\Access\Oidc\OidcException;
+use BookStack\Auth\Access\Oidc\OidcService;
use BookStack\Http\Controllers\Controller;
use Illuminate\Http\Request;
$loginDetails = $this->oidcService->login();
} catch (OidcException $exception) {
$this->showErrorNotification($exception->getMessage());
+
return redirect('/login');
}
$this->oidcService->processAuthorizeResponse($request->query('code'));
} catch (OidcException $oidcException) {
$this->showErrorNotification($oidcException->getMessage());
+
return redirect('/login');
}