Improved JWT handling and fixed test server behaviour

Change-Id: I169dbaa3afbb059e2b2c99bc2fc0f5f417ad57a5
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index ed45db1..0b68f9f 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -27,10 +27,10 @@
 % content_for 'sidebar', begin
 <fieldset>
   %= form_for 'login', begin
-    <legend><span><%= loc 'login' %></span></legend>
-    <input type="text" name="handle_or_email" placeholder="<%= loc 'email' %>" />
+  <legend><span><%= loc 'login' %></span></legend>
+    %= text_field 'handle_or_email', placeholder => loc('email')
     <div>
-      <input type="password" name="pwd" placeholder="<%= loc 'pwd' %>" />
+      %= password_field 'pwd', placeholder => loc('pwd')
       <button type="submit"><span><%= loc 'go' %></span></button>
     </div>
   % end