Skip to content

Commit

Permalink
add namespace to locked password command (#4369)
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell authored Jan 18, 2024
1 parent f19444f commit 48852d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/handlers/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ func (h *Handler) Login(w http.ResponseWriter, r *http.Request) {
JSON(w, http.StatusUnauthorized, loginResponse)
return
} else if err == user.ErrTooManyAttempts {
loginResponse.Error = "Admin Console has been locked. Please reset password using the \"kubectl kots reset-password\" command."
resetPasswordCmd := "kubectl kots reset-password"
if util.PodNamespace != "" {
resetPasswordCmd = fmt.Sprintf("%s -n %s", resetPasswordCmd, util.PodNamespace)
}
loginResponse.Error = fmt.Sprintf("Admin Console has been locked. Please reset password using the \"%s\" command.", resetPasswordCmd)
JSON(w, http.StatusUnauthorized, loginResponse)
return
} else if err != nil {
Expand Down

0 comments on commit 48852d6

Please sign in to comment.