Hooking into actions not handled by CodeEvent


Well-known member
My current use-case is I want to attach some logic to the code right after someone logs in. From what I've found there's no clear way of determining this based on the events fired through CodeEvent. I can think of several ways to achieve this anyway, but I'd like to know if there is a way XenForo can support hooks like this without getting into hacking too much (at all)?

Any tips?



Well-known member
You should be able to use the controller_pre_dispatch event listener and have it watch for the "login" action firing on the "login" controller. That would work for someone actually logging in. Now for someone who has been gone for awhile, but automatically logs in via cookies, that wouldn't work... so depends on what *exactly* you are trying to do.