Skip to content

Commit

Permalink
Adjust user migration namepsace to be connection name; modify DB scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Jun 4, 2019
1 parent ae488bb commit 48020fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/WP_Auth0_Api_Operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
);

Expand Down
6 changes: 3 additions & 3 deletions lib/scripts-js/db-get-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ function getByEmail (email, callback) {

var wpUser = JSON.parse(body);

// Error returned from WordPress, exit.
if (wpUser.error) {
callback(null);
// Error returned from WordPress or no data, exit.
if (wpUser.error || ! wpUser.data) {
return callback(null);
}

// Use WordPress profile data to populate Auth0 account.
Expand Down
6 changes: 3 additions & 3 deletions lib/scripts-js/db-login.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ function login (email, password, callback) {

var wpUser = JSON.parse(body);

// Error returned from WordPress, exit.
if (wpUser.error) {
callback(null);
// Error returned from WordPress or no data, exit.
if (wpUser.error || ! wpUser.data) {
return callback(null);
}

// Use WordPress profile data to populate Auth0 account.
Expand Down
2 changes: 1 addition & 1 deletion tests/testApiOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testThatCreateConnectionWithMigrationRequestsCorrectly() {
);

$this->assertEquals(
get_auth0_curatedBlogName(),
'DB-' . get_auth0_curatedBlogName(),
$caught_http['body']['options']['bareConfiguration']['userNamespace']
);
}
Expand Down

0 comments on commit 48020fa

Please sign in to comment.