I've got two problems/questions regarding AuthKit. Please find my development.ini below.
These are my questions:
1. I would like to do some operations after the user has logged in (fetch some things from database and insert them into the user's session). Where should I place the code for that?
2. Every time after logging in via POSTing username and password, the next page isn't totally loaded (the browser get's back only part of the full DOM). If I reload the page, the whole DOM-Object is loaded. If I send username and password via GET instead, the whole DOM-Object is also loaded. But having username and password in the URL looks ugly. What can be the cause of this problem and what might be a possible solution?
Hope someone can help me.
Best regards,
Andre
My development.ini:
[DEFAULT]
debug = true
smtp_server = localhost
error_email_from = paste@localhost
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 5000
[app:main]
use = egg:toolbox
full_stack = true
cache_dir = %(here)s/data
beaker.session.key = lalaland
beaker.session.secret = <<secret>>
# SQLAlchemy database URL
sqlalchemy.url = <<secret>>
# AuthKit
authkit.setup.enable = true
authkit.setup.method = form, cookie
authkit.form.authenticate.user.type = lalaland.model.user:UsersFromDatabase
authkit.form.authenticate.user.data = lalaland.model
authkit.form.template.obj = lalaland.lib.template:make_login_template
authkit.cookie.secret = <<secret>>
authkit.cookie.signoutpath = /logout/logout
> 1. I would like to do some operations after the user has logged in (fetch some things from database and insert them into the user's session). Where should I place the code for that?
I think there is callback for that (at least I have seen in when I
looked into AuthKit code yesterday -
http://authkit.org/svn/AuthKit/trunk/authkit/authenticate/form.py,
search for self.auth_func). You will have problems with user sessions
in 0.9.6. In 0.9.7rc4 you will have chance to update session
(environ['beaker.session']).
Again I could offer my own form authentication middleware because you
could do what you want just by reading documentation. Please read
other my e-mails.
> 2. Every time after logging in via POSTing username and password, the next page isn't totally loaded (the browser get's back only part of the full DOM). If I reload the page, the whole DOM-Object is loaded. If I send username and password via GET instead, the whole DOM-Object is also loaded. But having username and password in the URL looks ugly. What can be the cause of this problem and what might be a possible solution?
That's somewhere in my head but I don't remember exactly. I think you
can't fix that in AuthKit but I just don't remember now why.
--
Dalius
http://blog.sandbox.lt
> I think that I will stay at AuthKit because it works fine for everything else I'm doing. There are only the two problems I described earlier.
James is reading this group now. Maybe he will answer ;-)
> You told me about a callback for doing some operations (inserting something into the session) immediately after the user logged in. I've taken a look at http://authkit.org/svn/AuthKit/trunk/authkit/authenticate/form.py but I don't know hot to implement that. May be my python/pylons knowledge isn't good enough yet!? :( Can you give me a little more help with that?
Sorry, that's all what I see myself. You should analyze code from there.
> Is there someone around who had the second problem (after logging in page isn't completely loaded) too and knows a solution?
I guess problem is that POST method does not re-post parameters.
That's all. I recommend showing form only to authorized users. Maybe
that's the problem?
--
Dalius
http://blog.sandbox.lt