Jump to content

Hook before ProcessLogin::execute not working


Sandy
 Share

Recommended Posts

Hi - Any idea why this isn't working?...

I want to render a message on the login screen, so added a hook to the /site/ready.php file:

<?php namespace ProcessWire;

if(!defined("PROCESSWIRE")) die();

$this->addHookBefore('ProcessLogin::execute', function(HookEvent $event) {

    echo "Test Message";

});

Any idea why it's not rendering anything? I copied the code straight from here: https://processwire.com/api/ref/process-login/execute/

Thanks

 

Link to comment
Share on other sites

On 4/21/2023 at 11:26 AM, Jan Romero said:

Unfortunately I have nothing to contribute, but I tested your exact code on a PW 3.0.183 installation of mine and it worked as expected, so maybe the problem lies somewhere else?

Thanks Jan. Yes, I've also got roughly the same code running successfully on another site, so it must be a setting somewhere.

Any ideas where to look for something that could interfere with a hook like that?

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...