From b4eb32c2224fbc20bfe96108702fc15ace2afa27 Mon Sep 17 00:00:00 2001 From: Kelvin Wang Date: Mon, 15 Jul 2019 14:06:02 -0400 Subject: [PATCH] fix(http): fixed auth userid overwrite --- http/auth_service.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/http/auth_service.go b/http/auth_service.go index d7e67a37fb..8913a2db47 100644 --- a/http/auth_service.go +++ b/http/auth_service.go @@ -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 {