Apparently some other code I had in controller was breaking functionality 
of this, now I reached the point when it actually displays the remember 
button, although upon successful login and log out it doesn't actually 
remember my info and nothing gets filled into the login form. 

On Thursday, August 24, 2017 at 5:04:02 PM UTC+2, Anthony wrote:
>
>
> controller.py
>> def index():
>>     auth.settings.remember_me_form=True
>>     auth.settings.long_expiration = 3600*24*30
>>     form = auth()
>>     return dict(form=form)
>>
>> view.html
>>     {{=form.custom.begin}}
>>     {{=form.custom.widget.email}}
>>     {{=form.custom.widget.password}}
>>     {{=form.custom.widget.remember_me}}
>>     {{=form.custom.widget.submit}}
>>     {{=form.custom.end}}
>>
>
> I cannot reproduce the problem -- using the exact code above, I do see a 
> checkbox added to the form. However, you have not included any of the field 
> labels, so the checkbox has no label (the label is in 
> form.custom.label.remember_me).
>
> Also, there is no form.custom.widget.submit, so you probably see the word 
> "None" right after the checkbox instead of seeing the login button. 
> Instead, it should just be form.custom.submit.
>
> Finally, when you call auth() and there are no URL args to indicate which 
> auth action you want (i.e., login, register, etc.), auth will force a 
> redirect to the current URL with /login appended. If you don't want that 
> and instead just want to display a login form on the index page, then 
> instead of calling auth(), call auth.login().
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to