Skip to content

Commit d3b9475

Browse files
committed
OpenID sendToAuthenticationUri lacks promise
Openid module sendToAuthenticationUri step did not provide correct Promise object reference to use inside this.relyingParty.authenticate callback function. Also call back function did not fulfill promise(caused timeout error) and step itself did not return promise reference (caused uncaught exception). original pull request bnoguchi#379 which was merged and still this problem arises
1 parent bf95b28 commit d3b9475

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/modules/openid.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ everyModule.submodule('openid')
5050
if (!this._myHostname || this._alwaysDetectHostname) {
5151
this.myHostname(extractHostname(req));
5252
}
53+
54+
var p = this.Promise();
5355

54-
this.relyingParty.authenticate(req.query[this.openidURLField()], false, function(err,authenticationUrl){
56+
this.relyingParty.authenticate(req.query[this.openidURLField()], false, (function(err,authenticationUrl){
5557
if(err) return p.fail(err);
5658
this.redirect(res, authenticationUrl);
57-
});
59+
}).bind(this));
60+
61+
p.fulfill();
62+
return p;
5863
})
5964
.getSession( function(req) {
6065
return req.session;

0 commit comments

Comments
 (0)