1
0
mirror of https://github.com/v2board/v2board.git synced 2025-02-13 08:50:27 +08:00

22 lines
461 B
PHP
Raw Normal View History

2019-10-29 15:33:36 +08:00
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
2020-01-11 13:36:52 +08:00
* @param \Illuminate\Http\Request $request
2019-10-29 15:33:36 +08:00
* @return string
*/
protected function redirectTo($request)
{
2020-01-11 13:36:52 +08:00
if (!$request->expectsJson()) {
2019-10-29 15:33:36 +08:00
return route('login');
}
}
}