Skip to content

Commit

Permalink
Merge pull request #32947 from vespa-engine/ean/specific-sso-enforcem…
Browse files Browse the repository at this point in the history
…ent-error

Ean/specific sso enforcement error
  • Loading branch information
ean authored Nov 26, 2024
2 parents 46569aa + efde493 commit 61a4a63
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions client/go/internal/cli/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ This command runs a browser-based authentication flow for the Vespa Cloud contro
})

if err != nil {
return fmt.Errorf("login error: %w", err)
switch err.Error() {
case "600":
return errHint(fmt.Errorf("Unable to login through social channels"),
"Your organization does not allow logging in through our social channels",
"Please login by entering your address into the email field")
default:
return fmt.Errorf("login error: %w", err)
}
}

cli.printSuccess("Logged in")

// store the refresh token
secretsStore := &auth.Keyring{}
err = secretsStore.Set(auth.SecretsNamespace, system.Name, res.RefreshToken)
Expand All @@ -93,7 +98,9 @@ This command runs a browser-based authentication flow for the Vespa Cloud contro
if err := a.WriteCredentials(creds); err != nil {
return fmt.Errorf("failed to write credentials: %w", err)
}
return err

cli.printSuccess("Logged in")
return nil
},
}
}

0 comments on commit 61a4a63

Please sign in to comment.