Skip to content

If user deleted in wordpress, need to invalid/expire token/ user not exist response #305

Description

@vinaye42

we got a report of a critical security issue in your plugin. If the user is deleted in wordpress, but the session in the app is still active,

You have to check in validate token if user exist or not like below image

user-exists

/** check user exist or not */
if( isset($token->data->user->id) ) {
	$user = get_userdata($token->data->user->id);
	
	if ( ! $user ) {
		return new WP_Error(
			'jwt_auth_bad_request',
			'User not found',
			[
				'status' => 403,
			]
		);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions