Fix handling of login errors

Change-Id: Ib8d6b7d3f8a8c572c07c45da3fd0f60fb2e58eb3
diff --git a/t/server/mock.pl b/t/server/mock.pl
index 18fd05d..79eeb90 100644
--- a/t/server/mock.pl
+++ b/t/server/mock.pl
@@ -229,6 +229,16 @@
           token_type => 'api_token'
         })
       );
+    }
+
+    elsif ($pwd eq 'ldaperr') {
+      return $c->render(
+        format => 'html',
+        status => 401,
+        json => {
+          "errors" => [[2022,"LDAP Authentication failed due to unknown user or password!"]]
+        }
+      );
     };
 
     return $c->render(