mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-26 00:50:12 +01:00
22 lines
506 B
PHP
22 lines
506 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Laravel\Passport\Http\Middleware\CreateFreshApiToken as CreateFreshApiToken;
|
|
|
|
class CustomCreateFreshApiToken extends CreateFreshApiToken
|
|
{
|
|
/**
|
|
* Determine if the request should receive a fresh token.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return bool
|
|
*
|
|
* @codeCoverageIgnore
|
|
*/
|
|
protected function requestShouldReceiveFreshToken($request)
|
|
{
|
|
return ! is_null($request->user($this->guard));
|
|
}
|
|
}
|