Skip to content

Commit

Permalink
Simplify code in cnsi.go (#4876)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Quandt <thquad@gmail.com>
  • Loading branch information
thquad authored and richard-cox committed Apr 16, 2021
1 parent e1ff34a commit 2ad6bb9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/jetstream/cnsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,15 @@ func (p *portalProxy) RegisterEndpoint(c echo.Context, fetchInfo interfaces.Info
cnsiClientSecret = p.GetConfig().CFClientSecret
}

sessionValue, err := p.GetSessionValue(c, "user_id")
uaaUserID, err := p.GetSessionStringValue(c, "user_id")
if err != nil {
return interfaces.NewHTTPShadowError(
http.StatusInternalServerError,
"Failed to get session user",
"Failed to get session user: %v", err)
}
uaaUserId := sessionValue.(string)

newCNSI, err := p.DoRegisterEndpoint(params.CNSIName, params.APIEndpoint, skipSSLValidation, cnsiClientId, cnsiClientSecret, uaaUserId, ssoAllowed, subType, overwriteEndpoints, fetchInfo)
newCNSI, err := p.DoRegisterEndpoint(params.CNSIName, params.APIEndpoint, skipSSLValidation, cnsiClientId, cnsiClientSecret, uaaUserID, ssoAllowed, subType, overwriteEndpoints, fetchInfo)
if err != nil {
return err
}
Expand Down

0 comments on commit 2ad6bb9

Please sign in to comment.