I'm having a similar problem. I am making a custom form with this code in
the view:
{{=form.custom.begin}}
<div class="control-group {{if form.errors['email']:}}error{{pass}}">
<label class="control-label" for="inputEmail">Email address</label>
<div class="controls">
{{=form.custom.widget.email}}
</div>
</div>
<div class="control-group {{if form.errors['password']:}}error{{pass}}">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
{{=form.custom.widget.password}}
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input id="auth_user_remember" class="checkbox"
type="checkbox" value="on" name="remember"> Remember me (for 30 days)
</label><br>
{{=form.custom.submit}}
</div>
</div>
{{=form.custom.end}}
But this does not log me in for some reason. If I use just {{=form}} here,
it does login as it's supposed to.
My controller looks like this:
def login():
if auth.is_logged_in():
redirect(URL('dashboard'))
response.subtitle = T("Login")
return dict(form=auth.login())
I can't figure out why it's not logging me in with the custom form..
On Wednesday, August 15, 2012 6:51:12 AM UTC+1, shartha wrote:
>
> Hello,
> Quick question:
> Instead of {{=auth.login()}}, I am using the following to be able to
> customize my login form. However the resulting form does not work and I
> cannot login with the same username/password that enable me to login if I
> had used {{=auth.login()}} -- I get the flash error: Invalid Login.
>
> Could someone please tell me what's possibly going wrong? Thanks!
>
> {{form=auth.login()}}
> {{=form.custom.begin}}
> Username:
> {{=form.custom.widget.username}}
> </br>
> Password:
> {{=form.custom.widget.password}}
> {{=form.custom.submit}}
> {{=form.custom.end}}
>
--