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

22 lines
507 B
PHP
Raw Normal View History

<?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
2024-07-03 11:16:08 +02:00
*
* @codeCoverageIgnore
*/
protected function requestShouldReceiveFreshToken($request)
{
2022-11-22 15:15:52 +01:00
return ! is_null($request->user($this->guard));
}
2022-11-22 15:15:52 +01:00
}