@param Token $token

@return bool
482266
protected function isTokenExpired($token)
    {
        return !$token ||
            (
                $token->getCreationTtl() > 0 &&
                time() > $token->getCreationTime() + $token->getCreationTtl()
            );
    }
837772
public function check($token)
    {
        $blacklistedToken = $this->model
            ->where('user_id', $this->Token->getSubject($token))
            ->where('expiry', '>', Carbon::now())
            ->whereToken($token)
            ->first();

        if ($blacklistedToken === null) {
            return true;
        }

        throw new BlacklistedTokenException();
    }
909259
public function invalidate(Token $token)
    {
        if (! $this->blacklistEnabled) {
            throw new JWTException('You must have the blacklist enabled to invalidate a token.');
        }

        return $this->blacklist->add($this->decode($token));
    }
391478
public function isTokenUnique($token) {

        $record = List_Unsubscribe_Token::where('token', $token)->first();

        if (!$record) {
            return true;
        }

        return false;
    }
783319
public function delete($token)
    {
        $query = $this->find(compact('token'));

        return $query->count() ? $this->getTable()->delete($query->first()) : false;
    }
506182
public function authenticate($token = false)
    {
        $id = $this->getPayload($token)->get('sub');
        if (! $this->auth->byId($id)) {
            return false;
        }

        return $this->auth->user();
    }
54657
public function verify($token = null)
    {
        $token = isset($token)
            ? $token
            : input()->postGet('csrf-token');

        if (is_string($token)) {
            return hash_equals($this->getToken(), $token);
        }

        return false;
    }
719861
public function findByActivationToken($token)
    {
        $userMeta = $this->userMeta->where('activation_token', $token)->first();

        if ($userMeta) {
            return $userMeta->user()->first();
        }

        return false;
    }
531282
public function toUser($token = false)
    {
        $payload = $this->getPayload($token);

        if (! $user = $this->user->getBy($this->identifier, $payload['sub'])) {
            return false;
        }

        return $user;
    }
1373854
public function userFromToken(string $token)
    {
        $user = $this->mapUserToObject($this->getUserByToken($token));
        return $user->setToken($token);
    }
870148
public function findByToken($token)
    {
        /** @var Query $query */
        $query = $this->isValid($token, true);
        if ($query === false) {
            return $query;
        }
        return $query->contain(['Users'])->first();
    }
1003109
public function validateToken($token)
    {
        $tokenChecksum = Mage::getSingleton('ecomdev_varnish/cookie')->get(self::COOKIE_TOKEN_CHECKSUM);
        if ($tokenChecksum === $this->getChecksum(array('token' => $token))) {
            return true;
        }

        return false;
    }
724142
private function _isInline($token)
    {
        return isset($this->htmlDefinition->info['p']->child->elements[$token->name]);
    }
1122784
public function verify($token)
    {
        try {
            $this->client()->head('authentication-tokens/{token}', ['token' => $token]);

            return true;
        } catch (NotFoundException $e) {
            return false;
        }
    }
174378
protected function valid($token)
    {
        try {
            (new HttpClient)->get(
                $this->sparkUrl.'/api/token/'.$token.'/validate',
                ['verify' => __DIR__.'/cacert.pem']
            );

            return true;
        } catch (Exception $e) {
            var_dump($e->getMessage());

            return false;
        }
    }
706675
public function verifyEmailWithToken($token)
    {
        $link = UserLink::where('link', $token)
            ->where('type', UserLink::VERIFY_EMAIL)
            ->first();

        if (!$link) {
            return false;
        }

        $userClass = $this->getUserClass();
        $user = $userClass::find($link->user_id);

        // enable the user and delete the verify link
        $user->enable();
        $link->delete();

        // send a welcome email
        $user->sendEmail('welcome');

        return $user;
    }
1288047
public function isValid(Token $token = null)
    {
        return !is_null($token) && $token->getType() == $this->config['type'] && $this->checkObfuscatePart($token);
    }