当前位置: 首页>>代码示例>>PHP>>正文


PHP JWTAuth::invalidate方法代码示例

本文整理汇总了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);
 }
开发者ID:masmike,项目名称:scafolding,代码行数:10,代码来源:AuthController.php

示例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);
 }
开发者ID:imjerrybao,项目名称:jwt-auth-guard,代码行数:12,代码来源:JwtAuthGuard.php

示例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");
 }
开发者ID:jtrupina,项目名称:mobile-app-challenge-2015-web,代码行数:13,代码来源:AuthController.php

示例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());
 }
开发者ID:masmike,项目名称:scafolding,代码行数:10,代码来源:BaseController.php

示例5: logout

 /**
  * Log out user. Blacklist the token.
  *
  * @return \Illuminate\Http\Response
  */
 public function logout()
 {
     JWTAuth::invalidate(JWTAuth::getToken());
     return 'Good';
 }
开发者ID:rossfinn1,项目名称:anvel-base-1,代码行数:10,代码来源:AuthController.php

示例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);
 }
开发者ID:Vladimir-Florian,项目名称:Pasu,代码行数:13,代码来源:UserController.php

示例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'));
 }
开发者ID:LazyJoker,项目名称:serverSideCode,代码行数:12,代码来源:AuthController.php

示例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;
 }
开发者ID:ajoelp,项目名称:portfolio-2015,代码行数:9,代码来源:AuthRepository.php


注:本文中的Tymon\JWTAuth\Facades\JWTAuth::invalidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。