Change Password support for Console (#457)
- Account change password endpoints - Change account password modal - Grouped account settings and service accounts - Removed the SuperAdmin credentials from almost all places, only missing place is Oauth login - Renamed service-accounts UI labels to account in Menu Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
This commit is contained in:
@@ -18,7 +18,6 @@ var (
|
||||
errorGenericUnauthorized = errors.New("unauthorized")
|
||||
errorGenericForbidden = errors.New("forbidden")
|
||||
errorGenericNotFound = errors.New("not found")
|
||||
errConnectingToMinio = errors.New("unable to connect to MinIO instance")
|
||||
// Explicit error messages
|
||||
errorInvalidErasureCodingValue = errors.New("invalid Erasure Coding Value")
|
||||
errorUnableToGetTenantUsage = errors.New("unable to get tenant usage")
|
||||
@@ -32,6 +31,7 @@ var (
|
||||
errPolicyBodyNotInRequest = errors.New("error policy body not in request")
|
||||
errInvalidEncryptionAlgorithm = errors.New("error invalid encryption algorithm")
|
||||
errSSENotConfigured = errors.New("error server side encryption configuration was not found")
|
||||
errChangePassword = errors.New("unable to update password, please check your current password")
|
||||
)
|
||||
|
||||
// prepareError receives an error object and parse it against k8sErrors, returns the right error code paired with a generic error message
|
||||
@@ -90,6 +90,11 @@ func prepareError(err ...error) *models.Error {
|
||||
errorCode = 401
|
||||
errorMessage = errorGenericInvalidSession.Error()
|
||||
}
|
||||
// account change password
|
||||
if errors.Is(err[0], errChangePassword) {
|
||||
errorCode = 403
|
||||
errorMessage = errChangePassword.Error()
|
||||
}
|
||||
if madmin.ToErrorResponse(err[0]).Code == "InvalidAccessKeyId" {
|
||||
errorCode = 401
|
||||
errorMessage = errorGenericInvalidSession.Error()
|
||||
|
||||
Reference in New Issue
Block a user