fix(http): fixed auth userid overwrite

pull/14344/head
Kelvin Wang 2019-07-15 14:06:02 -04:00
parent e9081d68a4
commit b4eb32c222
1 changed files with 6 additions and 1 deletions

View File

@ -198,7 +198,12 @@ func (h *AuthorizationHandler) handlePostAuthorization(w http.ResponseWriter, r
return return
} }
auth := req.toPlatform(user.ID) userID := user.ID
if req.UserID != nil && req.UserID.Valid() {
userID = *req.UserID
}
auth := req.toPlatform(userID)
org, err := h.OrganizationService.FindOrganizationByID(ctx, auth.OrgID) org, err := h.OrganizationService.FindOrganizationByID(ctx, auth.OrgID)
if err != nil { if err != nil {