Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ean/specific sso enforcement error #32947

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
},
}
}
Loading