Skip to content

Commit

Permalink
Merge pull request #810 from auth0/fix-popup-mode
Browse files Browse the repository at this point in the history
Fix: popup does not close when signup fails
  • Loading branch information
glena authored Jan 17, 2017
2 parents 8e17718 + ccebdd9 commit c7385d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/connection/database/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ export function signUp(id) {
});
}

webApi.signUp(id, params, (error, ...args) => {
webApi.signUp(id, params, (error, result, popupHandler, ...args) => {
if (error) {
if (!!popupHandler) {
popupHandler._current_popup.kill();
}
setTimeout(() => signUpError(id, error), 250);
} else {
signUpSuccess(id, ...args);
signUpSuccess(id, result, popupHandler, ...args);
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/core/web_api/legacy_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Auth0LegacyAPIClient {

const popupHandler = (autoLogin && popup) ? this.client.popup.preload() : null;

this.client.signup(options, (err, result) => cb(err, result, popupHandler) );
this.client.signup(options, (err, result) => cb(err, result, popupHandler));
}

resetPassword(options, cb) {
Expand Down
4 changes: 1 addition & 3 deletions src/core/web_api/p2_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ class Auth0APIClient {

delete options.autoLogin;

const popupHandler = (autoLogin && popup) ? this.client.popup.preload() : null;

this.client.signup(options, (err, result) => cb(err, result, popupHandler) );
this.client.signup(options, (err, result) => cb(err, result));
}

resetPassword(options, cb) {
Expand Down

0 comments on commit c7385d9

Please sign in to comment.