Return an error code if form password is wrong.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 19:27:29 +0000 (21:27 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 19:27:29 +0000 (21:27 +0200)
src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java

index fb0a5bb..918cb97 100644 (file)
@@ -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);