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

Login does not respect if the User belongs to the site in a multi-site network #142

Open
natac13 opened this issue Oct 15, 2021 · 1 comment

Comments

@natac13
Copy link

natac13 commented Oct 15, 2021

A user on one site in a multi-site network should not be able to login into another site via this plugin.

Currently that is the case.

@oddpixel
Copy link

oddpixel commented Feb 1, 2022

Also having the same issue, users can log into any of the multisite networks sites.

My fix:

In /src/Auth.php, in the login_and_get_token function after $user = self::authenticate_user( $username, $password ); I added the following:

`

	if ( is_multisite() ) {  
		if ( ! is_user_member_of_blog( $user->data->ID ) ) {  
			return new UserError( __( 'The user could not be found', 'wp-graphql-jwt-authentication' ) );  
		}  
	}`

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

2 participants