diff --git a/cli/rest/auth/handlers.go b/cli/rest/auth/handlers.go index 01315d2e..e26e00e2 100644 --- a/cli/rest/auth/handlers.go +++ b/cli/rest/auth/handlers.go @@ -2,6 +2,7 @@ package auth import ( "crypto/rand" + "crypto/sha256" "fmt" "net/http" "strings" @@ -26,7 +27,8 @@ func HandlerLogin(ctx *context.Context) http.HandlerFunc { auth := r.Header.Get("Authorization") if auth == "" { - if body.Password != ctx.Config().Password { + password := fmt.Sprintf("%X", sha256.Sum256([]byte(body.Password))) + if password != ctx.Config().Password { utils.WriteErrorToResponse(w, http.StatusUnauthorized, 3, "") return }