2FAuth/app/Http/Middleware/Authenticate.php

23 lines
491 B
PHP
Raw Normal View History

2019-05-20 07:37:41 +02: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.
*
* @param \Illuminate\Http\Request $request
* @return string
2020-10-09 13:35:03 +02:00
* @codeCoverageIgnore
2019-05-20 07:37:41 +02:00
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}