Sorry, last message got mangled somehow. Here goes again.
Sebastian, here's what I'm using:
# model
auth = Auth(db)
...
def complete_login(form):
from gluon import HTTP
# do some stuff with form as necessary
response.flash = 'You are now logged in'
response.js = 'ajax("%s",[],":eval:);' % URL(
c='user', f='cb_after_login', extension=False)
# note: Anthony does this
# raise HTTP(200, response.render())
raise HTTP(200, SCRIPT(response.js))
auth.settings.login_onaccept = [complete_login]
# controller
def login():
return dict(form=auth.login())
def cb_after_login():
return 'jQuery("#login-dialog").dialog("close");'
# view
<div id='login-dialog'>
{{=form}}
</div>
<script>
jQuery("#login-dialog").dialog({
autoOpen: false
, width: 'auto'
, height: 'auto'
, modal: true
, draggable: false
, closeOnEscape: true
});
</script>
# note: this method uses the jquery ui dialog box, so you need to
# install and load that javascript before running any of this
This has been transcribed from original code, so there may be a typo
in here. No warranty ;-) But I think it should be good to go.
Good luck. Note - you *WILL* get burned, as stated by pbreit, when you
try to access code that has been decorated by @auth.requires_login().
That's because you will be directed to your login page, which no
longer exists. So you will have to figure out what to do about that.
I'm in the process of figuring that out.