I haven't tried it, but maybe something along these lines:

def login():
    form = auth.login(next=URL('default', 'login'))
    if not request.post_vars:
        return form.formkey

On the client side, you would make an initial Ajax request to login() when 
setting up your login form/widget -- in that case, login() will return a 
formkey as a string (which it will also store in the session). Upon login, 
send an Ajax post request to login() with the formkey value in a '_formkey' 
field. Once the login is processed, it should redirect back to login(), 
which will then return a new formkey value.

Anthony

On Friday, January 20, 2012 8:45:39 AM UTC-5, Phyo Arkar wrote:
>
> To keep it simple.
>
> How can i login (without using form) to web2py Auth  via AJAX?
>
> Thanks
>
> Phyo.
>
> On Fri, Jan 20, 2012 at 7:45 PM, Phyo Arkar <phyo.ar...@gmail.com> wrote:
>
>> hello web2py.
>>
>> I am trying to get auth working with qooxdoo , can i know how should i 
>> login using ajax and (ofcoz use session) of webpy?
>>
>> Thanks
>>
>> Phyo.
>>
>
>

Reply via email to