This commit is contained in:
2026-01-05 13:13:07 +08:00
parent 47f32c9f2e
commit d92a05407c
+5 -1
View File
@@ -100,7 +100,9 @@ func checkUserAuthorization(userID, accessToken string) (bool, string, error) {
authCheckURL := fmt.Sprintf("%s", AuthorizationURL)
reqBody := map[string]string{
"user_id": userID,
"user_id": userID,
"resource": "dashboard",
"action": "view",
}
jsonData, err := json.Marshal(reqBody)
@@ -115,6 +117,7 @@ func checkUserAuthorization(userID, accessToken string) (bool, string, error) {
return false, "", err
}
log.Print("JSON Data Sent to AuthZ Service: ", string(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+accessToken)
@@ -134,6 +137,7 @@ func checkUserAuthorization(userID, accessToken string) (bool, string, error) {
return false, "", err
}
log.Printf("AUTHZ RESPONSE for user %s: %+v", userID, authResp)
helper.LogInfo(fmt.Sprintf("Authorization check for user %s: allowed=%v, redirect=%s, message=%s",
userID, authResp.Allowed, authResp.RedirectRoute, authResp.Message))