HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Anybody know how to hook in after sign in with a valid UserID

My goal is to get a hook after the Sign in handler and after there is a UserID determined in Session.

BUT.... I only want the the event I am triggering to get executed once (after signin with a valid Userid) but not something that will occur on every page load.

Hope this is clear, and better yet maybe someone know of a hook or technique to just do the even once per login session.

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Comments

  • ShadowdareShadowdare r_j MVP
    edited March 2013

    The AfterSignIn event in EntryController is fired after the UserID is determined. It should execute only once after sign in.

    Add Pages to Vanilla with the Basic Pages app

  • @Shadowdare said:
    Does the AfterSignIn event in EntryController work?

    thx. Shadowdare

    there doesn't appear to be an event like that.

    I put this in and sign in and it signs me in, so i think there is not a handler, nor did I see one in the code.

    public function EntryController_AfterSignIn_Handler($Sender) {

    die();
    }

    I put this in and it dies so there is a handler - just not the correct one for me.
    public function EntryController_SignIn_Handler($Sender) {

    die();
    }

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I may just add my own eventhandler in the entrycontroller, if I don't get a better idea on one that works.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • GaryFunkGaryFunk Senior Application Developer ✭✭

    In 2.1 it is there in class.entrycontroller.php 5 times.

         Gdn::UserModel()->FireEvent('AfterSignIn');
    
  • peregrineperegrine MVP
    edited March 2013

    thx Gary,

    perfect - saved me some time on placement and a trifecta under the circumstances

    I just copied it into the appropriate place 2.0.18.4 entrycontroller.

    • If people want to change the core for extra benefit, it will work

    • if they don't, no errors,

    • and it will be ready for 2.1

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I've tried to add this event, and for my it does not trigger (when coming in via a login from /entry). I had to add the FireEvent inside the SignIn() function of the EntryController to get this to fire for me. Am I meant to be adding some other hook for Connect() to sucessfully handle the FireEvent?

Sign In or Register to comment.