2021-10-22 14:18:13 +02:00
|
|
|
<?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
|
2021-10-22 14:18:13 +02:00
|
|
|
*/
|
|
|
|
protected function requestShouldReceiveFreshToken($request)
|
|
|
|
{
|
2022-11-22 15:15:52 +01:00
|
|
|
return ! is_null($request->user($this->guard));
|
2021-10-22 14:18:13 +02:00
|
|
|
}
|
2022-11-22 15:15:52 +01:00
|
|
|
}
|