mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 17:31:49 +08:00 
			
		
		
		
	update: rollback token cache
This commit is contained in:
		| @@ -19,7 +19,7 @@ class Client | ||||
|     public function handle($request, Closure $next) | ||||
|     { | ||||
|         $token = $request->input('token'); | ||||
|         if (empty($token) || $this->tokenNotInCache($token)) { | ||||
|         if (empty($token)) { | ||||
|             abort(403, 'token is null'); | ||||
|         } | ||||
|         $user = User::where('token', $token)->first(); | ||||
| @@ -29,12 +29,4 @@ class Client | ||||
|         $request->user = $user; | ||||
|         return $next($request); | ||||
|     } | ||||
|  | ||||
|     private function tokenNotInCache($token) | ||||
|     { | ||||
|         // schedule init complete? | ||||
|         if (!Cache::get(CacheKey::get('SCHEDULE_LAST_CHECK_AT', null))) return true; | ||||
|         if (Cache::get(CacheKey::get('SUBSCRIBE_TOKEN', $token))) return false; | ||||
|         return true; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user