1. 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?

Discussion in 'XenForo Development Discussions' started by rhodes, Nov 22, 2013.

  1. rhodes

    rhodes Active Member

    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
     
  2. Liam W

    Liam W Well-Known Member

    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
     
  3. rhodes

    rhodes Active Member

    Sorry for posting in the wrong section.

    Rhodes
     
  4. Liam W

    Liam W Well-Known Member

    I'm sure the staff aren't fussed ;)
     
  5. rhodes

    rhodes Active Member

    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
     
  6. AndyB

    AndyB Well-Known Member

Share This Page