Skip to content

Commit

Permalink
Add hints and proper error message for SSO enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
Eirik Nygaard committed Nov 26, 2024
1 parent c7f4b77 commit 3800ff5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/go/internal/cli/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@ 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":
cli.printErr(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")
return fmt.Errorf("Unauthorized")
default:
return fmt.Errorf("login error: %w", err)
}
}

// store the refresh token
Expand Down

0 comments on commit 3800ff5

Please sign in to comment.