[wp-trac] [WordPress Trac] #15473: wp_login action can't deal with alternate auth mechanisms

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 18 19:10:58 UTC 2010


#15473: wp_login action can't deal with alternate auth mechanisms
--------------------------+-------------------------------------------------
 Reporter:  Otto42        |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Users         |     Version:  3.1            
 Severity:  minor         |    Keywords:                 
--------------------------+-------------------------------------------------
Description changed by Otto42:

Old description:

> In the wp_signon function, the action hook for wp_login in called like
> this:
> do_action('wp_login', $credentials['user_login']);
>
> Problem is that $credentials['user_login'] is the content of the form
> field passed to it by the login screen. If an alternate authentication
> mechanism is used (like via Twitter or Facebook), then the action does
> not get the resulting user name that is logging in.
>
> Fix:
>
> If the $user variable is_a WP_User object, then the value passed to this
> action hook should be $user->user_login instead, so as to pass the login
> name of the authenticated user to the action.

New description:

 In the wp_signon function, the action hook for wp_login is called like
 this:
 `do_action('wp_login', $credentials['user_login']);`

 Problem is that `$credentials['user_login']` is the content of the form
 field passed to it by the login screen. If an alternate authentication
 mechanism is used (like via Twitter or Facebook), then the action does not
 get the resulting user name that is logging in.

 Fix:

 If the $user variable is_a WP_User object, then the value passed to this
 action hook should be $user->user_login instead, so as to pass the login
 name of the authenticated user to the action.

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15473#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list