from gluon.tools import *
class MyAuth(Auth):
def login(
self,
next=None,
onvalidation=None,
onaccept=None,
log=None,
):
Auth.login(self,next,onvalidation,onaccept,log)
if self.environment.session.auth:
self.environment.session.blah = somevalue
auth=MyAuth(globals(),db) # authentication/
authorization
Of course, my "something like this" doesn't work. What's the correct
way to do this?
Thanks in advance...
def mystuff(form): do_something_with(form.vars)
auth.settings.login_onaccept=mystuff
A) The auth.settings.login_onaccept function is invoked in addition to
auth.settings.register_onaccept because the register function
automatically logs me in.
B) The register function does not automatically log me in but instead
redirects to the login page for me to supply my new login info (and
consequently get auth.settings.login_onaccept invoked along the way).
or
C) The documentation for auth.settings.login_onaccept makes clear the
fact that it does not apply to the automatic login that happens at
registration time. This way we know we need to duplicate
auth.settings.login_onaccept in auth.settings.register_onaccept.