Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after registration the default hooks like "wp_login" aren't triggered #22905

Closed
SebastianTusk opened this issue Feb 28, 2019 · 2 comments
Closed

Comments

@SebastianTusk
Copy link

After registration the new user is immediately authenticated. This is done without triggering Wordpress hooks like "wp_login". This might break plugins using these hooks.

@mikejolley
Copy link
Member

wp_login is triggered via wp_signon which expects user credentials.

https://codex.wordpress.org/Function_Reference/wp_signon

During registration we're not accepting logon credentials, so passing those around and validating login details does not occur. Triggering it manually could lead to undesirable outcomes. e.g. a captcha plugin using wp_login would break the automatic-logon after registration.

Therefore it's probably not a good idea to trigger this action nor call wp_signon etc in this case.

https://github.com/WordPress/WordPress/blob/655d44ffe813eb9a64e30a6339316338246e9efc/wp-includes/pluggable.php#L815

wp_set_auth_cookie triggers it's own hooks which could be intercepted if desired.

set_auth_cookie
set_logged_in_cookie

To avoid conflicts, I don't think we should be firing wp_login hooks.

If you need to disable auto-login in woocommerce, add:

add_filter( 'woocommerce_registration_auth_new_customer', '__return_false' );

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants