Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix GetUserInfoFromToken for v4 of backend #116

Closed
wants to merge 1 commit into from

Conversation

consolethinks
Copy link
Collaborator

It updates the GetUserInfoFromToken function to properly interact with scicat backend v4.

@@ -54,12 +54,12 @@ func GetUserInfoFromToken(client *http.Client, APIServer string, token string) (
if err != nil {
return map[string]string{}, []string{}, err
}
req2, err := http.NewRequest("GET", APIServer+"/users/"+url.QueryEscape(newUserInfo.Id)+"/userIdentity", nil)
filterString := url.QueryEscape(fmt.Sprintf("{\"where\":{\"userId\":\"%s\"}}", newUserInfo.Id))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs say

{
"where?": {
"profile.email": "[email protected]"
}
}
This last version is deprecated and will be discontinued as soon as the FE is updated.
It has been maintanined for backward compatibility.

Looks like it shouldn't have the 'where' clause.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this solution from the frontend I think, but I'll recheck with the original method for v3.

@@ -54,12 +54,12 @@ func GetUserInfoFromToken(client *http.Client, APIServer string, token string) (
if err != nil {
return map[string]string{}, []string{}, err
}
req2, err := http.NewRequest("GET", APIServer+"/users/"+url.QueryEscape(newUserInfo.Id)+"/userIdentity", nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint seems to still exist (at least in release-jobs). What's the issue here?

@consolethinks
Copy link
Collaborator Author

This change is not necessary anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants