@dataunions/default-join-server
Advanced tools
{ | ||
"name": "@dataunions/default-join-server", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "A join server that extends the base join server by adding app secret validation and Streamr-awareness", | ||
@@ -36,3 +36,3 @@ "author": "Data Union DAO <contact@dataunions.org>", | ||
"@dataunions/client": "3.0.0", | ||
"@dataunions/join-server": "3.0.1", | ||
"@dataunions/join-server": "3.0.2", | ||
"dotenv": "16.0.2", | ||
@@ -39,0 +39,0 @@ "mysql2": "2.3.3", |
@@ -0,5 +1,7 @@ | ||
const { InvalidRequestError } = require('@dataunions/join-server') | ||
module.exports = (db) => { | ||
return async (address, joinRequest) => { | ||
if (!joinRequest.secret) { | ||
throw new Error(`App secret not provided by ${address}`) | ||
throw new InvalidRequestError(`App secret not provided by ${address}`) | ||
} | ||
@@ -11,5 +13,5 @@ | ||
|| secret.chain !== joinRequest.chain) { | ||
throw new Error(`Invalid app secret provided by ${address}`) | ||
throw new InvalidRequestError(`Invalid app secret provided by ${address}`) | ||
} | ||
} | ||
} |
13409
0.72%249
0.4%