upwork / php-upwork-oauth2

PHP bindings for Upwork API (OAuth2)
Apache License 2.0
10 stars 6 forks source link

grantType parameter is ignored when I authenticate #17

Closed viperet closed 11 months ago

viperet commented 11 months ago

When I authenticate using this library for the first time to get refreshToken, my 'grantType' parameter in \Upwork\API\Config constructor is ignored unless I also specify 'expiresIn' parameter. But since I don't yet have any tokens, I had to pass some random date in the past to overcome this issue.

I think there is an error in the library code, and line https://github.com/upwork/php-upwork-oauth2/blob/6f80eed2ee7da340f59d31c2a4188696267fd026/src/Upwork/API/Client.php#L64C11-L64C11 should be !$grantType|| $this->_server->option('grantType', $grantType); That way 'grantType' option won't depend on presence of 'expiresIn'.

mnovozhylov commented 11 months ago

Fixed in v2.4.1

viperet commented 11 months ago

Many thanks, @mnovozhylov. I had a lot of trouble because of this!