From f8b1b8ad37cca7ed63d656d5646c43a35dc201c8 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 22 Mar 2025 01:47:40 -0500 Subject: [PATCH] return unauthorized when decryption fails --- repertory/repertory/src/ui/handlers.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index a937a080..70592762 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -154,7 +154,10 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server) } res.set_content(data.dump(), "application/json"); - res.status = http_error_codes::internal_error; + res.status = utils::string::ends_with(data["error"].get(), + "|decryption failed") + ? http_error_codes::unauthorized + : http_error_codes::internal_error; }); server->Get("/api/v1/mount",