本文整理汇总了PHP中Tymon\JWTAuth\Facades\JWTAuth::invalidate方法的典型用法代码示例。如果您正苦于以下问题:PHP JWTAuth::invalidate方法的具体用法?PHP JWTAuth::invalidate怎么用?PHP JWTAuth::invalidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tymon\JWTAuth\Facades\JWTAuth
的用法示例。
在下文中一共展示了JWTAuth::invalidate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inValidateToken
public function inValidateToken()
{
$tempStorage = app('\\App\\Http\\Controllers\\TEMPStorage\\UserTempStorage');
$tempStorage->forget('id_company');
//set model login
$user = JWTAuth::parseToken()->authenticate();
$this->model->find($user->id)->update(['login' => 0]);
JWTAuth::invalidate(JWTAuth::getToken());
return API::response()->array(['message' => 'success'])->statusCode(200);
}
示例2: invalidate
/**
* Invalidate current token (add it to the blacklist).
*
* @param boolean $forceForever
*
* @return boolean
*/
public function invalidate($forceForever = false)
{
$this->parseToken();
return JWTAuth::invalidate($forceForever);
}
示例3: logout
/**
* Log out
* Invalidate the token, so user cannot use it anymore
* They have to relogin to get a new token
*
* @param Request $request
*/
public function logout(Request $request)
{
$this->validate($request, ['token' => 'required']);
JWTAuth::invalidate($request->input('token'));
return json_encode("success");
}
示例4: invalidateToken
/**
* to invalidate token
* @return [type] [description]
*/
protected function invalidateToken()
{
//logout if login withtout company
$this->tempStorage->forget('id_company');
\Tymon\JWTAuth\Facades\JWTAuth::invalidate(JWTAuth::getToken());
}
示例5: logout
/**
* Log out user. Blacklist the token.
*
* @return \Illuminate\Http\Response
*/
public function logout()
{
JWTAuth::invalidate(JWTAuth::getToken());
return 'Good';
}
示例6: logout
/**
* Log out
* Invalidate the token, so user cannot use it anymore
* They have to relogin to get a new token
*
* @param Request $request
*/
public function logout(Request $request)
{
$this->validate($request, ['token' => 'required']);
JWTAuth::invalidate($request->input('token'));
return response()->json('logged out', 200);
}
示例7: logout
/**
* Log out
* Invalidate the token, so user cannot use it anymore
* They have to relogin to get a new token
*
* @param Request $request
*/
public function logout(Request $request)
{
$this->validate($request, ['token' => 'required']);
JWTAuth::invalidate($request->input('token'));
}
示例8: logout
public function logout($token)
{
if (!$token) {
throw new Exception('THERE WAS AN ERROR LOGGING THIS USER OUT', 500);
}
$token = str_replace("Bearer ", "", $token);
JWTAuth::invalidate($token);
return true;
}