ソースを参照

change domain verification logic

Shawn Lu 2 年 前
コミット
863459d8aa
2 ファイル変更2 行追加2 行削除
  1. 1 1
      lib/strategy.js
  2. 1 1
      package.json

+ 1 - 1
lib/strategy.js

@@ -46,7 +46,7 @@ Strategy.prototype.authenticate = function(req, options) {
     return self.fail({ message: 'URI mismatch.' }, 403);
   }
   
-  var domain = url.parse(origin).host;
+  const domain = new URL(req.get("origin")).host;
   if (domain !== siweMessage.domain) {
     return self.fail({ message: 'Domain mismatch.' }, 403);
   }

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "passport-ethereum-siwe",
+  "name": "shawnlu96-passport-ethereum-siwe",
   "version": "0.1.0",
   "description": "Ethereum authentication strategy for Passport.",
   "keywords": [