iamoceans commented on issue #13356:
URL: https://github.com/apache/gravitino/issues/13356#issuecomment-5751030120
I'd like to work on this. The response shape in `refreshToken` is the cause
(line numbers
are on `main`):
- `web-v2/web/src/lib/store/auth/index.js:81` — `const { access_token,
expires_in } = res.data`
- `web-v2/web/src/lib/store/auth/index.js:99` — `const { access_token,
expires_in } = res` (the login path)
`loginApi` goes through `defHttp`, whose `isTransformResponse` default is
`false`
(`web-v2/web/src/lib/utils/axios/index.js:344`). That branch of
`transformResponseHook`
returns `res.data` (`web-v2/web/src/lib/utils/axios/index.js:64-66`) — the
response body
itself — so `res.data` is `undefined` here and the destructuring throws
exactly the
reported `TypeError`.
One thing I'd add to the description: I checked the commit for #7429 and it
changed the
refresh interval and the idle handling, but not this line, so the `res.data`
read was
left behind in both copies:
- `web/web/src/lib/store/auth/index.js:63` — `const { access_token,
expires_in } = res.data`
`web/web`'s axios wrapper has the same `isTransformResponse: false` default
(`web/web/src/lib/utils/axios/index.js:295`), and `branch-1.3` still
contains both files
unchanged.
Plan: read the body from `res` in `web-v2/web` so the refresh path matches
the login
path, plus a regression test that dispatches `refreshToken` with `loginApi`
resolving to
the token body — it fails with `auth/refreshToken/rejected` before the
change.
I can include the one-line `web/web` fix in the same PR, or keep the PR to
`web-v2/web`
and leave the legacy UI alone — whichever you prefer. Could you assign this
to me?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]