Merge pull request #14344 from influxdata/auth_create_user_fix

fix(http): fixed auth userid overwrite
pull/14346/head
kelwang 2019-07-15 14:19:34 -04:00 committed by GitHub
commit d45bd1bb83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -198,7 +198,12 @@ func (h *AuthorizationHandler) handlePostAuthorization(w http.ResponseWriter, r
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)
if err != nil {