Skip to content

Commit a428b44

Browse files
fix: update error handling to use errorInfo instead of cause for login errors
1 parent f316473 commit a428b44

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/web-auth/hosted-pages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ HostedPages.prototype.signupAndLogin = function(options, cb) {
128128
}
129129
return _this.login(options, function(loginErr, result) {
130130
if (loginErr) {
131-
loginErr.cause = {
131+
loginErr.errorInfo = {
132132
error_code: 'login_error',
133133
message: 'Your account was created successfully, but we could not log you in automatically. Please try logging in with your new credentials.'
134134
};

src/web-auth/popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ Popup.prototype.signupAndLogin = function(options, cb) {
327327
}
328328
_this.loginWithCredentials(options, function(loginErr, result) {
329329
if (loginErr) {
330-
loginErr.cause = {
330+
loginErr.errorInfo = {
331331
error_code: 'login_error',
332332
message: 'Your account was created successfully, but we could not log you in automatically. Please try logging in with your new credentials.'
333333
};

src/web-auth/redirect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Redirect.prototype.signupAndLogin = function (options, cb) {
6666

6767
return _this.webAuth.login(options, function (loginErr, result) {
6868
if (loginErr) {
69-
loginErr.cause = {
69+
loginErr.errorInfo = {
7070
error_code: 'login_error',
7171
message: 'Your account was created successfully, but we could not log you in automatically. Please try logging in with your new credentials.'
7272
};

test/web-auth/hosted-pages.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ describe('auth0.WebAuth._universalLogin', function() {
391391
expect(data).to.be(undefined);
392392
expect(err.code).to.be('invalid_user_password');
393393
expect(err.description).to.be('Wrong email or password.');
394-
expect(err.cause).to.eql({
394+
expect(err.errorInfo).to.eql({
395395
error_code: 'login_error',
396396
message: 'Your account was created successfully, but we could not log you in automatically. Please try logging in with your new credentials.'
397397
});

test/web-auth/popup.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ describe('auth0.WebAuth.popup', function() {
816816
expect(data).to.be(undefined);
817817
expect(err.code).to.be('invalid_user_password');
818818
expect(err.description).to.be('Wrong email or password.');
819-
expect(err.cause).to.eql({
819+
expect(err.errorInfo).to.eql({
820820
error_code: 'login_error',
821821
message: 'Your account was created successfully, but we could not log you in automatically. Please try logging in with your new credentials.'
822822
});

test/web-auth/redirect.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ describe('auth0.WebAuth.redirect', function() {
301301
expect(data).to.be(undefined);
302302
expect(err.code).to.be('invalid_user_password');
303303
expect(err.description).to.be('Wrong email or password.');
304-
expect(err.cause).to.eql({
304+
expect(err.errorInfo).to.eql({
305305
error_code: 'login_error',
306306
message: 'Your account was created successfully, but we could not log you in automatically. Please try logging in with your new credentials.'
307307
});

0 commit comments

Comments
 (0)