Skip to content

Commit

Permalink
Revert "Don't use storage when inside the UNiversal Login Page (#889)"
Browse files Browse the repository at this point in the history
This reverts commit 9b2a98f.
  • Loading branch information
luisrudge authored Jan 21, 2019
1 parent 4a76400 commit af8d16d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/web-auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,14 @@ WebAuth.prototype.login = function(options, cb) {
'nonce'
])
.with(options);
params = this.transactionManager.process(params);

var isHostedLoginPage = windowHelper.getWindow().location.host === this.baseOptions.domain;
if (isHostedLoginPage) {
params.connection = params.realm;
delete params.realm;
this._universalLogin.login(params, cb);
} else {
params = this.transactionManager.process(params);
this.crossOriginAuthentication.login(params, cb);
}
};
Expand Down Expand Up @@ -794,4 +794,4 @@ WebAuth.prototype.passwordlessVerify = function(options, cb) {
});
};

export default WebAuth;
export default WebAuth;
1 change: 1 addition & 0 deletions src/web-auth/username-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ UsernamePassword.prototype.login = function(options, cb) {
'audience'
])
.with(options);
body = this.transactionManager.process(body);

body = objectHelper.toSnakeCase(body, ['auth0Client']);

Expand Down
4 changes: 2 additions & 2 deletions test/web-auth/hosted-pages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ describe('auth0.WebAuth._universalLogin', function() {
}
);
});
it('should not call transactionManager.process', function(done) {
it('should use transactionManager.process', function(done) {
stub(request, 'post', function() {
expect(TransactionManager.prototype.process.calledOnce).to.be(false);
expect(TransactionManager.prototype.process.calledOnce).to.be(true);
done();
});

Expand Down
6 changes: 3 additions & 3 deletions test/web-auth/web-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2268,6 +2268,7 @@ describe('auth0.WebAuth', function() {
clientID: '...',
responseType: 'token',
redirectUri: 'http://page.com/callback',
state: 'randomState',
connection: 'bar'
};
stub(HostedPages.prototype, 'login', function(options, cb) {
Expand Down Expand Up @@ -2351,8 +2352,7 @@ describe('auth0.WebAuth', function() {
error_description: "responseType can't be `code`"
});
});
});
it('throws an error if redirectUri is empty', function() {
});it('throws an error if redirectUri is empty', function() {
this.auth0.checkSession({ redirectUri: '' }, function(err) {
expect(err).to.be.eql({
error: 'error',
Expand Down Expand Up @@ -2569,4 +2569,4 @@ describe('auth0.WebAuth', function() {
webAuth.validateToken('token', 'nonce', function() {});
});
});
});
});

0 comments on commit af8d16d

Please sign in to comment.