thephpleague / oauth1-client

OAuth 1 Client
MIT License
968 stars 73 forks source link

Add checks for token and secret to Server->createTokenCredentials() #92

Closed elazar closed 6 years ago

elazar commented 6 years ago

If a server (e.g. Xero) does not return a token for any reason (see its documentation), Server currently generates a notice because the data is assumed to be present in createTokenCredentials() and isn't in such cases.

Notice: Undefined index: oauth_token
 () at /src/vendor/league/oauth1-client/src/Client/Server/Server.php:487
 League\OAuth1\Client\Server\Server->createTokenCredentials()

This PR adds checks and throws appropriate instances of CredentialsException if either the token or the secret is missing.