return unauthorized when decryption fails
This commit is contained in:
parent
03c8f3461e
commit
f8b1b8ad37
@ -154,7 +154,10 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.set_content(data.dump(), "application/json");
|
res.set_content(data.dump(), "application/json");
|
||||||
res.status = http_error_codes::internal_error;
|
res.status = utils::string::ends_with(data["error"].get<std::string>(),
|
||||||
|
"|decryption failed")
|
||||||
|
? http_error_codes::unauthorized
|
||||||
|
: http_error_codes::internal_error;
|
||||||
});
|
});
|
||||||
|
|
||||||
server->Get("/api/v1/mount",
|
server->Get("/api/v1/mount",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user