CreateFreshApiToken
class CreateFreshApiToken
Methods
static string
using(string|null $guard = null)
Specify the guard for the middleware.
Response
bool
shouldReceiveFreshToken(Request $request, Response $response, string|null $guard)
Determine if the given request should receive a fresh token.
bool
requestShouldReceiveFreshToken(Request $request, string|null $guard)
Determine if the request should receive a fresh token.
bool
responseShouldReceiveFreshToken(Response $response)
Determine if the response should receive a fresh token.
bool
alreadyContainsToken(Response $response)
Determine if the given response already contains an API token.
Details
at line 20
__construct(ApiTokenCookieFactory $cookieFactory)
Create a new middleware instance.
at line 28
static string
using(string|null $guard = null)
Specify the guard for the middleware.
at line 40
Response
handle(Request $request, Closure $next, string|null $guard = null)
Handle an incoming request.
at line 59
protected bool
shouldReceiveFreshToken(Request $request, Response $response, string|null $guard)
Determine if the given request should receive a fresh token.
at line 68
protected bool
requestShouldReceiveFreshToken(Request $request, string|null $guard)
Determine if the request should receive a fresh token.
at line 76
protected bool
responseShouldReceiveFreshToken(Response $response)
Determine if the response should receive a fresh token.
at line 88
protected bool
alreadyContainsToken(Response $response)
Determine if the given response already contains an API token.
This avoids us overwriting a just "refreshed" token.