• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Which hook is fired after successful login?

rhodes

Active member
#1
Hello,

I am writing an addon that fetches some data from a remote service and I need it to execute its function each time a user logs in.

Is there a hook that gets fired after login that I can add an action to?

Thanks

Rhodes
 

Liam W

Well-known member
#2
Hello,

I am writing an addon that fetches some data from a remote service and I need it to execute its function each time a user logs in.

Is there a hook that gets fired after login that I can add an action to?

Thanks

Rhodes
This should really be in the developer discussion forum ;)

Also, that sort of isn't how the xenForo system works...

What you will probably want to do is use the XenForo class proxy system to dynamically extend the login controller, and then add your code at the end of the actionLogin function.

Just remember to call the parent!

Liam
 

rhodes

Active member
#5
Hello,

I am writing an addon that fetches some data from a remote service and I need it to execute its function each time a user logs in.

Is there a hook that gets fired after login that I can add an action to?

I found class XenForo_ControllerPublic_Login with a function "actionLogin()", but I'm not sure how to add my custom function Mylogintasks() and execute it automatically after a successful login.

actionMylogintasks() won't create any output in xenforo but connects to another cms via REST as mentioned above.

I'm sure this question sounds trivial for those who are more experienced in xf development, but unfortunately this stuff is new to me and very different from what I do normally (drupal development).

Maybe someone has a hint for me.

Thanks

Rhodes