roryqi commented on code in PR #12778:
URL: https://github.com/apache/gravitino/pull/12778#discussion_r3903997253
##########
docs/open-api/authn.yaml:
##########
@@ -23,15 +23,16 @@ paths:
get:
tags:
- authentication
- summary: Get the authenticated principal
+ summary: Get the authenticated user
operationId: getAuthenticatedPrincipal
Review Comment:
Fixed in dc5d8f7bc. Renamed the operationId to getAuthenticatedUser and
validated the OpenAPI specification with ./gradlew :docs:build.
##########
web-v2/web/src/lib/store/auth/index.js:
##########
@@ -45,14 +44,23 @@ export const getAuthConfigs =
createAsyncThunk('auth/getAuthConfigs', async () =
// ** get the first authenticator from the response. response example:
"[simple, oauth]"
authType = res['gravitino.authenticators'][0].trim()
anthEnable = res['gravitino.authorization.enable']
- serviceAdmins = res['gravitino.authorization.serviceAdmins']
localStorage.setItem('oauthUrl', oauthUrl)
// Persist authType for axios interceptor to avoid circular dependency with
Redux store
localStorage.setItem('authType', authType)
- return { oauthUrl, authType, anthEnable, serviceAdmins, systemConfig: res }
+ return { oauthUrl, authType, anthEnable, systemConfig: res }
+})
+
+export const getAuthMe = createAsyncThunk('auth/getAuthMe', async () => {
+ const [err, res] = await to(getAuthMeApi())
+
+ if (err || !res) {
+ throw new Error(err)
+ }
+
+ return res
})
Review Comment:
Fixed in dc5d8f7bc. The thunk now rethrows Error instances unchanged,
converts non-Error values with String(), and reports an explicit error for an
empty response.
--
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]