teamreflex / oauth2-discord

OAuth2 client for authenticating with the Discord API servers
MIT License
61 stars 26 forks source link

Request doesn't accept the 4th argument #7

Closed chonsser closed 7 years ago

chonsser commented 8 years ago

Hello, I've a problem. The request from Discord OAuth2 provider api doesn't accept the 4th argument ($options). As you can see, the AbstractProvider->getAuthenticatedRequest have the 4th argument called $options for body, headers or protocolVersion data. OAuth2-discord doesn't pass the 4th argument.

Discord provider:

/**
     * Runs a request.
     *
     * @param string      $method The HTTP method.
     * @param string      $url    The URL.
     * @param AccessToken $token  The auth token.
     *
     * @return array Response.
     */
    public function request($method, $url, $token)
    {
        $request = $this->getAuthenticatedRequest(
            $method, $url, $token
        );

        return $this->getResponse($request);
    }

AbstractProvider (from oauth2-client)

    /**
     * Returns an authenticated PSR-7 request instance.
     *
     * @param  string $method
     * @param  string $url
     * @param  AccessToken|string $token
     * @param  array $options Any of "headers", "body", and "protocolVersion".
     * @return RequestInterface
     */
    public function getAuthenticatedRequest($method, $url, $token, array $options = [])
    {
        return $this->createRequest($method, $url, $token, $options);
    }
davidcole1340 commented 7 years ago

Sorry for the late reply, not sure what you are saying, would you like me to add the $options argument?

chonsser commented 7 years ago

Yes, exactly.