Skip to content

Commit

Permalink
Remove get user route check for username
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Jun 4, 2019
1 parent 48020fa commit a396681
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions lib/WP_Auth0_Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ protected function migration_ws_get_user() {
$username = $_POST['username'];

$user = get_user_by( 'email', $username );
if ( ! $user ) {
$user = get_user_by( 'slug', $username );
}

if ( ! $user ) {
throw new Exception( __( 'User not found', 'wp-auth0' ), 401 );
Expand Down
7 changes: 0 additions & 7 deletions tests/testRoutesGetUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,5 @@ public function testThatGetUserRouteReturnsUserIfSuccessful() {
$this->assertEquals( $user->display_name, $output_em->data->display_name );
$this->assertObjectNotHasAttribute( 'user_pass', $output_em->data );
$this->assertEmpty( self::$error_log->get() );

// Test username lookup.
$_POST['username'] = $user->user_login;
$output_un = json_decode( self::$routes->custom_requests( self::$wp, true ) );

$this->assertEquals( $output_em, $output_un );
$this->assertEmpty( self::$error_log->get() );
}
}

0 comments on commit a396681

Please sign in to comment.