andbang-express-auth
Advanced tools
Comparing version 0.0.5 to 0.0.6
16
index.js
@@ -69,8 +69,10 @@ var _ = require('underscore'), | ||
req.session.oauthState = crypto.createHash('sha1').update(crypto.randomBytes(4098)).digest('hex'); | ||
var url = self.accountsUrl + '/oauth/authorize?' + querystring.stringify({ | ||
response_type: 'code', | ||
client_id: self.clientId, | ||
state: req.session.oauthState | ||
req.session.save(function () { | ||
var url = self.accountsUrl + '/oauth/authorize?' + querystring.stringify({ | ||
response_type: 'code', | ||
client_id: self.clientId, | ||
state: req.session.oauthState | ||
}); | ||
res.redirect(url); | ||
}); | ||
res.redirect(url); | ||
}); | ||
@@ -82,7 +84,7 @@ | ||
if (result.error) { | ||
response.redirect('/auth/andbang/failed'); | ||
return response.redirect('/auth/andbang/failed'); | ||
} | ||
if (result.state != req.session.oauthState) { | ||
response.redirect('/auth/andbang/failed'); | ||
return response.redirect('/auth/andbang/failed'); | ||
} | ||
@@ -89,0 +91,0 @@ |
{ | ||
"name": "andbang-express-auth", | ||
"description": "Dead simple And Bang auth middleware.", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "express": "3.x", |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
9875
199
0