Hook on_login not enough


I need to do server side calls to database and need to do other stuff but after user successfully login. I need to use frappe.local.session.

The hook on_session_creation is perfect because it is called when user successfully login and frappe.local.session exists.

The hook on_login is not, because is called before the creation of frappe.local.session.

So my question is:
Is any thing like after_user_login hook?

If not, i think it is important to be notified that user successfully login and use the frappe.local.session to do stuff after user login.


Why don’t you add one and send PR?


I will do it tomorrow. It takes one line of code…


Just to clarify my confusion:

There is no need to create a hook to be called after user successfully login.

hook on_login is called before session is created and on_session_creation is called after successfully login and session is created. So first is called on_login and after that is called on_session_creation.

1 Like