@sh-a-v/passport-passwordless
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -109,5 +109,5 @@ var util = require('util'); | ||
//get request parameters to check the authentication state | ||
var user = this.getParam(req.query, this.options.userField, 'user'); | ||
var token = this.getParam(req.query, this.options.tokenField, 'token'); | ||
var uid = this.getParam(req.query, this.options.uidField, 'uid'); | ||
var user = this.getParam(req, this.options.userField, 'user'); | ||
var token = this.getParam(req, this.options.tokenField, 'token'); | ||
var uid = this.getParam(req, this.options.uidField, 'uid'); | ||
@@ -127,4 +127,8 @@ //if a token and a uid was specified, verify the token | ||
//Get a parameter value from an object. | ||
PasswordlessStrategy.prototype.getParam = function (obj, field, defaultField) { | ||
return obj[field || defaultField]; | ||
PasswordlessStrategy.prototype.getParam = function(req, field, defaultField) { | ||
var key = field || defaultField; | ||
if (req.body && req.body[key]) { | ||
return req.body[key]; | ||
} | ||
return req.query[key]; | ||
}; | ||
@@ -131,0 +135,0 @@ |
{ | ||
"name": "@sh-a-v/passport-passwordless", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Passport module for the passwordless library.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
20091
314