authorize (WP_User|null|WP_Error $wpUser) : WP_User|WP_Error $return
This is a global filter to introduce an authorization workflow for WordPress.
Execute an authorization check after a user has been authenticated
If the authorization fails, you should return an WP_Error object, otherwise the previously authenticated WP_User object.
The previously authenticated user (= instance of WP_User), an error or null. You are responsible to check if the parameter is an authenticated user or not.