Skip to content

Commit

Permalink
Merge pull request #74 from waylaidwanderer/patch-1
Browse files Browse the repository at this point in the history
Fix identifierRegex failing because of Steam upgrading http requests with TLS
  • Loading branch information
tobbbles authored Apr 6, 2018
2 parents 559ea32 + fbcf2f3 commit 97ea178
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/passport-steam/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function getUserProfile(key, steamID, callback) {
*/
function Strategy(options, validate) {
options = options || {};
options.providerURL = options.providerURL || 'http://steamcommunity.com/openid';
options.providerURL = options.providerURL || 'https://steamcommunity.com/openid';
options.profile = (options.profile === undefined) ? true : options.profile;
options.stateless = true; //Steam only works as a stateless OpenID

Expand All @@ -85,7 +85,7 @@ function Strategy(options, validate) {

function verify(req, identifier, profile, done) {
var validOpEndpoint = 'https://steamcommunity.com/openid/login';
var identifierRegex = /^http:\/\/steamcommunity\.com\/openid\/id\/(\d+)$/;
var identifierRegex = /^https?:\/\/steamcommunity\.com\/openid\/id\/(\d+)$/;

if(req.query['openid.op_endpoint'] !== validOpEndpoint ||
!identifierRegex.test(identifier)) {
Expand Down
2 changes: 1 addition & 1 deletion test/strategy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function getStrategy () {
}

test("Whether the providerURL is steam's", t => {
t.same(getStrategy()._providerURL, 'http://steamcommunity.com/openid')
t.same(getStrategy()._providerURL, 'https://steamcommunity.com/openid')
});

test("Whether the strategy name is 'steam'", t => {
Expand Down

0 comments on commit 97ea178

Please sign in to comment.