2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Middleware;
|
|
|
|
|
2022-02-26 16:15:20 +00:00
|
|
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
2015-12-06 18:58:49 +00:00
|
|
|
|
2022-02-26 16:15:20 +00:00
|
|
|
class Authenticate extends Middleware
|
2015-12-06 18:58:49 +00:00
|
|
|
{
|
|
|
|
/**
|
2022-02-26 16:15:20 +00:00
|
|
|
* Get the path the user should be redirected to when they are not authenticated.
|
2015-12-06 18:58:49 +00:00
|
|
|
*
|
2022-02-26 16:15:20 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
2017-11-03 23:16:49 +00:00
|
|
|
*
|
2022-02-26 16:15:20 +00:00
|
|
|
* @return string|null
|
2015-12-06 18:58:49 +00:00
|
|
|
*/
|
2022-02-26 16:15:20 +00:00
|
|
|
protected function redirectTo($request)
|
2015-12-06 18:58:49 +00:00
|
|
|
{
|
2022-02-26 16:15:20 +00:00
|
|
|
if (!$request->expectsJson()) {
|
|
|
|
return '/';
|
2015-12-06 18:58:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|