riok / Kreya

Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
https://kreya.app
284 stars 5 forks source link

Retry on invalid_grant authentication #224

Closed DominicMCN closed 3 months ago

DominicMCN commented 5 months ago

Describe the bug

When a refresh_token is expired, or environment changed (different credentials needed); a request authentication would fail. We would need to manually go to auth tab and click reset and update.

I vaguely remember a few versions ago, manual reset was not needed.

To Reproduce Steps to reproduce the behavior:

  1. Authenticates with OAuth
  2. Let the token / refresh_token expires ; or change to a different environment which needs reauth
  3. Request would fail

Expected behavior

Kreya retries authentication from the beginning of the OAuth flow at least one

CommonGuy commented 5 months ago

Which Kreya version are you using? I am unable to reproduce this with Kreya 1.14.0. Invoking an operation automatically fetches a valid token for me.

When you switch to the details tab in the authentication, does the token show as invalid/expired?

DominicMCN commented 5 months ago

1.14.1-beta 1

It does show as invalid-grant yea. I'll capture a screenshot when it expires again

DominicMCN commented 5 months ago
Screenshot 2024-05-01 at 14 58 05 Screenshot 2024-05-01 at 14 58 18
CommonGuy commented 5 months ago

Ah now I got it. The bug only happens when a refresh token is present, but invalid/expired. We'll fix this in the next release

CommonGuy commented 4 months ago

This has been fixed in the latest beta version and will be released in the next stable version

CommonGuy commented 3 months ago

Kreya 1.15 has just been released, which fixes this.