ellaisys / aws-cognito

AWS Cognito package (with MFA Feature) using the AWS SDK for PHP/Laravel
https://ellaisys.github.io/aws-cognito/
MIT License
110 stars 41 forks source link

RefreshToken returns array instead of AwsCognitoClaim #88

Closed mlab817 closed 9 months ago

mlab817 commented 9 months ago

Describe the bug In the documentation for refresh token, it is telling us to check if the $claim is an AwsCognitoClaim. However, in RefreshToken.php line 97, the refresh function is returning an array through this line of code:

return $claim->getData();

This returns an array instead of the instance of AwsCognitoClaim.

To Reproduce Try out the code provided in the documentation using postman.

Expected behavior The refresh() function should return the $claim instead of $claim->getData().

Screenshots N/A

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context None.

amitdhongde commented 9 months ago

Hey @mlab817, We have updated the implementation for the refresh token but missed updating the readme. The logic is now more simpler. Pushed the updated readme.

This is all that you need to do now

return $this->refresh($request, 'email', 'refresh_token'); 

or 

return $this->refresh($request); //If the params are email and refresh_token