mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 12:27:28 +00:00
Fix: Select org when using init
This commit is contained in:
@@ -74,6 +74,21 @@ var initCmd = &cobra.Command{
|
|||||||
|
|
||||||
selectedOrganization := organizations[index]
|
selectedOrganization := organizations[index]
|
||||||
|
|
||||||
|
tokenResponse, err := api.CallSelectOrganization(httpClient, api.SelectOrganizationRequest{OrganizationId: selectedOrganization.ID})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
util.HandleError(err, "Unable to select organization")
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the config jwt token to the new token
|
||||||
|
userCreds.UserCredentials.JTWToken = tokenResponse.Token
|
||||||
|
err = util.StoreUserCredsInKeyRing(&userCreds.UserCredentials)
|
||||||
|
httpClient.SetAuthToken(tokenResponse.Token)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
util.HandleError(err, "Unable to store your user credentials")
|
||||||
|
}
|
||||||
|
|
||||||
workspaceResponse, err := api.CallGetAllWorkSpacesUserBelongsTo(httpClient)
|
workspaceResponse, err := api.CallGetAllWorkSpacesUserBelongsTo(httpClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
util.HandleError(err, "Unable to pull projects that belong to you")
|
util.HandleError(err, "Unable to pull projects that belong to you")
|
||||||
|
|||||||
Reference in New Issue
Block a user