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

Fix migration namespace and callback #694

Merged
merged 3 commits into from
Jun 4, 2019

Conversation

joshcanhelp
Copy link
Contributor

@joshcanhelp joshcanhelp commented Jun 4, 2019

Changes

  • Change the namespace used when creating a new custom DB connection
  • Remove the check for username on the get user endpoint
  • Add client_id to the update user API call

Testing

  • This change adds unit test coverage
  • This change has been tested on WP 5.2.1

Checklist

  • All existing and new tests complete without errors
  • All code quality tools/guidelines in the Contribution guide have been run/followed
  • All active GitHub CI checks have passed

@@ -84,7 +84,7 @@ public function create_wordpress_connection( $app_token, $migration_enabled, $pa
'bareConfiguration' => array(
'endpointUrl' => site_url( 'index.php?a0_action=' ),
'migrationToken' => $migration_token,
'userNamespace' => get_auth0_curatedBlogName(),
'userNamespace' => 'DB-' . get_auth0_curatedBlogName(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for new installations and has not been released yet so OK to change.

@@ -217,9 +217,6 @@ protected function migration_ws_get_user() {
$username = $_POST['username'];

$user = get_user_by( 'email', $username );
if ( ! $user ) {
Copy link
Contributor Author

@joshcanhelp joshcanhelp Jun 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint should only used be used to check the email address.

@@ -66,6 +66,7 @@ public function call( $user_id = null, $email = null ) {
->add_body( 'email', $email )
// Email is either changed by an admin or verified by WP.
->add_body( 'email_verified', true )
->add_body( 'client_id', $this->options->get( 'client_id' ) )
Copy link
Contributor Author

@joshcanhelp joshcanhelp Jun 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended by the API docs for this endpoint

@joshcanhelp joshcanhelp added this to the 3.11.0 milestone Jun 4, 2019
@joshcanhelp joshcanhelp marked this pull request as ready for review June 4, 2019 21:39
@joshcanhelp joshcanhelp merged commit 0f3f2f1 into master Jun 4, 2019
@joshcanhelp joshcanhelp removed the tiny label Jun 4, 2019
@joshcanhelp joshcanhelp deleted the fix-migration-namespace-and-callback branch July 9, 2019 13:38
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants