From: David ‘Bombe’ Roden Date: Fri, 22 Oct 2010 19:27:29 +0000 (+0200) Subject: Return an error code if form password is wrong. X-Git-Tag: 0.1-RC1~83 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b5661eeaf3b6e20b099291f2cf65ab6989f9f363;p=Sone.git Return an error code if form password is wrong. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java index fb0a5bb..918cb97 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java @@ -165,7 +165,7 @@ public abstract class JsonPage implements Page { if (needsFormPassword()) { String formPassword = request.getHttpRequest().getParam("formPassword"); if (!webInterface.formPassword().equals(formPassword)) { - return new Response(401, "Not authorized", "application/json", JsonUtils.format(new JsonObject().put("success", false))); + return new Response(401, "Not authorized", "application/json", JsonUtils.format(new JsonObject().put("success", false).put("error", "auth-required"))); } } JsonObject jsonObject = createJsonObject(request);