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

Prevent wp_user creation #185

Open
ravid007 opened this issue Dec 23, 2024 · 0 comments
Open

Prevent wp_user creation #185

ravid007 opened this issue Dec 23, 2024 · 0 comments

Comments

@ravid007
Copy link

I'm using the rtcamp.google_user_authenticated hook for custom login permission checks. After a successful check, I map the google login to a specific generic user (BGuest) with the following code:

$user = get_user_by('login', 'BGuest');
wp_set_current_user($user->ID);
wp_set_auth_cookie($user->ID);
do_action('wp_login', $user->user_login, $user);

The login mapping works perfectly, and the user is logged in as BGuest. However, WordPress still creates a new user using the Google account details.
I've noticed that I need to set WP_GOOGLE_LOGIN_USER_REGISTRATION = true in order to pass the first login screen. If this is set to false, I cannot proceed with the login.

Is there a hook or another way to prevent WordPress from creating new users while still allowing the login process to proceed?

Any help would be greatly appreciated!
Thanks,
Ravid

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

1 participant