2020-04-09 13:05:23 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
2020-04-14 15:58:24 +02:00
|
|
|
use Illuminate\Support\Facades\URL;
|
2020-04-09 13:05:23 +02:00
|
|
|
|
|
|
|
|
class Authenticate extends Middleware
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Get the path the user should be redirected to when they are not authenticated.
|
|
|
|
|
*
|
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
|
* @return string|null
|
|
|
|
|
*/
|
|
|
|
|
protected function redirectTo($request)
|
|
|
|
|
{
|
2021-08-04 11:55:23 +02:00
|
|
|
if (!$request->expectsJson()) {
|
2020-04-14 15:58:24 +02:00
|
|
|
session(['redirectURL' => URL::full()]);
|
|
|
|
|
return route('saml2_login', 'ldc');
|
2020-04-09 13:05:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|