public function isValidToken($login, $jwtWrapper, $token)
    {
        $user = $this->getByLoginField($login);

        if (is_null($user)) {
            throw new UserNotFoundException('User not found!');
        }

        if ($user->get('TOKEN_HASH') !== sha1($token)) {
            throw new NotAuthenticatedException('Token does not match');
        }

        $data = $jwtWrapper->extractData($token);

        $this->save($user);

        return [
            'user' => $user,
            'data' => $data->data
        ];
    }
public function isValidToken($login, $jwtWrapper, $token)
    {
        $user = $this->getByLoginField($login);

        if (is_null($user)) {
            throw new UserNotFoundException('User not found!');
        }

        if ($user->get('TOKEN_HASH') !== sha1($token)) {
            throw new NotAuthenticatedException('Token does not match');
        }

        $data = $jwtWrapper->extractData($token);

        $this->save($user);

        return [
            'user' => $user,
            'data' => $data->data
        ];
    }
public function isValidToken ( $ login , $ jwtWrapper , $ token ) { $ user = $ this -> getByLoginField ( $ login ) ; if ( is_null ( $ user ) ) { throw new UserNotFoundException ( 'User not found!' ) ; } if ( $ user -> get ( 'TOKEN_HASH' ) !== sha1 ( $ token ) ) { throw new NotAuthenticatedException ( 'Token does not match' ) ; } $ data = $ jwtWrapper -> extractData ( $ token ) ; $ this -> save ( $ user ) ; return [ 'user' => $ user , 'data' => $ data -> data ] ; }
Check if the Auth Token is valid

@param string $login
@param JwtWrapper $jwtWrapper
@param string $token
@return array
@throws NotAuthenticatedException
@throws UserNotFoundException
@throws \ByJG\Serializer\Exception\InvalidArgumentException
@throws \ByJG\Util\JwtWrapperException
Check if the Auth Token is valid