Skip to content

Commit cbe707a

Browse files
committed
Make username/password required in login form
On login form, require both password and login name. Neither can be empty. Addeing required to both input field will invoke browser validation (where available) indicating a problem when logging in.
1 parent 722c336 commit cbe707a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

share/roundup/templates/classic/html/page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
129129
tal:attributes="action request/base">
130130
<p class="userblock">
131131
<b i18n:translate="">Login</b><br>
132-
<input size="10" name="__login_name"><br>
133-
<input size="10" type="password" name="__login_password"><br>
132+
<input size="10" required name="__login_name"><br>
133+
<input size="10" type="password" required name="__login_password"><br>
134134
<input type="hidden" name="@action" value="Login">
135135
<input type="checkbox" name="remember" id="remember">
136136
<label for="remember" i18n:translate="">Remember me?</label><br>

share/roundup/templates/devel/html/page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ <h1><a href="/">Roundup Demo Tracker</a></h1>
162162
<ul>
163163
<li>
164164
<tal:span i18n:translate="">Login</tal:span><br/>
165-
<input size="10" name="__login_name"/><br/>
166-
<input size="10" type="password" name="__login_password"/><br/>
165+
<input size="10" required name="__login_name"/><br/>
166+
<input size="10" type="password" required name="__login_password"/><br/>
167167
<input name="@csrf" type="hidden"
168168
tal:attributes="value python:utils.anti_csrf_nonce()">
169169
<input type="hidden" name="@action" value="Login"/>

share/roundup/templates/jinja2/html/layout/navigation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@
110110
<i class='icon-user'></i>{% trans %}Login{% endtrans %}
111111
</li>
112112
<li class="nav-item">
113-
<input class="form-control form-control-sm" type='text' name="__login_name" placeholder='username'>
113+
<input class="form-control form-control-sm" type='text' required name="__login_name" placeholder='username'>
114114
</li>
115115
<li class="nav-item">
116-
<input class="form-control form-control-sm" type="password" name="__login_password" placeholder='password'>
116+
<input class="form-control form-control-sm" type="password" required name="__login_password" placeholder='password'>
117117
</li>
118118
<li class="nav-item">
119119
<label class="form-control form-control-sm" class='checkbox'>

share/roundup/templates/minimal/html/page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
129129
tal:attributes="action request/base">
130130
<p class="userblock">
131131
<b i18n:translate="">Login</b><br>
132-
<input size="10" name="__login_name"><br>
133-
<input size="10" type="password" name="__login_password"><br>
132+
<input size="10" required name="__login_name"><br>
133+
<input size="10" type="password" required name="__login_password"><br>
134134
<input name="@csrf" type="hidden"
135135
tal:attributes="value python:utils.anti_csrf_nonce()">
136136
<input type="hidden" name="@action" value="Login">

share/roundup/templates/responsive/html/page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@
177177
<form method="post" tal:attributes="action request/base">
178178
<fieldset>
179179
<legend><i class='icon-user'></i>Login form</legend>
180-
<input name="__login_name" type='text' placeholder='Username' i18n:attributes="placeholder">
181-
<input type="password" name="__login_password" placeholder='Password' i18n:attributes="placeholder">
180+
<input name="__login_name" type='text' placeholder='Username' i18n:attributes="placeholder" required>
181+
<input type="password" name="__login_password" placeholder='Password' i18n:attributes="placeholder" required>
182182
<input name="@csrf" type="hidden"
183183
tal:attributes="value python:utils.anti_csrf_nonce()">
184184
<input type="hidden" name="@action" value="Login"/>

0 commit comments

Comments
 (0)