fixed
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user