Update v1.0.6.5
This commit is contained in:
37
vendor/tymon/jwt-auth/src/JWTManager.php
vendored
37
vendor/tymon/jwt-auth/src/JWTManager.php
vendored
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of jwt-auth.
|
||||
*
|
||||
* (c) Sean Tymon <tymon148@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Tymon\JWTAuth;
|
||||
|
||||
use Tymon\JWTAuth\Exceptions\JWTException;
|
||||
@@ -24,12 +33,12 @@ class JWTManager
|
||||
protected $payloadFactory;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $blacklistEnabled = true;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $refreshFlow = false;
|
||||
|
||||
@@ -46,7 +55,7 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode a Payload and return the Token
|
||||
* Encode a Payload and return the Token.
|
||||
*
|
||||
* @param \Tymon\JWTAuth\Payload $payload
|
||||
* @return \Tymon\JWTAuth\Token
|
||||
@@ -59,7 +68,7 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a Token and return the Payload
|
||||
* Decode a Token and return the Payload.
|
||||
*
|
||||
* @param \Tymon\JWTAuth\Token $token
|
||||
* @return Payload
|
||||
@@ -79,7 +88,7 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh a Token and return a new Token
|
||||
* Refresh a Token and return a new Token.
|
||||
*
|
||||
* @param \Tymon\JWTAuth\Token $token
|
||||
* @return \Tymon\JWTAuth\Token
|
||||
@@ -97,16 +106,16 @@ class JWTManager
|
||||
return $this->encode(
|
||||
$this->payloadFactory->make([
|
||||
'sub' => $payload['sub'],
|
||||
'iat' => $payload['iat']
|
||||
'iat' => $payload['iat'],
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate a Token by adding it to the blacklist
|
||||
* Invalidate a Token by adding it to the blacklist.
|
||||
*
|
||||
* @param Token $token
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function invalidate(Token $token)
|
||||
{
|
||||
@@ -118,7 +127,7 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the PayloadFactory instance
|
||||
* Get the PayloadFactory instance.
|
||||
*
|
||||
* @return \Tymon\JWTAuth\PayloadFactory
|
||||
*/
|
||||
@@ -128,7 +137,7 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the JWTProvider instance
|
||||
* Get the JWTProvider instance.
|
||||
*
|
||||
* @return \Tymon\JWTAuth\Providers\JWT\JWTInterface
|
||||
*/
|
||||
@@ -138,7 +147,7 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Blacklist instance
|
||||
* Get the Blacklist instance.
|
||||
*
|
||||
* @return \Tymon\JWTAuth\Blacklist
|
||||
*/
|
||||
@@ -148,7 +157,7 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the blacklist is enabled
|
||||
* Set whether the blacklist is enabled.
|
||||
*
|
||||
* @param bool $enabled
|
||||
*/
|
||||
@@ -160,9 +169,9 @@ class JWTManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the refresh flow
|
||||
* Set the refresh flow.
|
||||
*
|
||||
* @param boolean $refreshFlow
|
||||
* @param bool $refreshFlow
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefreshFlow($refreshFlow = true)
|
||||
|
Reference in New Issue
Block a user