コード例 #1
0
 public function destroy()
 {
     $payload = $this->getAuthToken();
     $user = $this->driver->validate($payload);
     if (!$user) {
         throw new NotAuthorizedException();
     }
     $this->driver->getProvider()->purge($user);
     return \Response::json(array('success' => true));
 }
コード例 #2
0
ファイル: TokenFilter.php プロジェクト: aanvari/auth-token
 function filter($route, $request)
 {
     $payload = $request->header('X-Auth-Token');
     if (empty($payload)) {
         $payload = $request->input('auth_token');
     }
     $user = $this->driver->validate($payload);
     if (!$user) {
         throw new NotAuthorizedException();
     }
     $this->events->fire('auth.token.valid', $user);
 }