diff --git a/controllers/api.js b/controllers/api.js index d653e36..37159f9 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -139,8 +139,12 @@ const postLimiter = rateLimit({ router.post('/create', postLimiter, async function (req, res) { logger.log('/create', [req.id]); - if (!(req.body.partnerid && req.body.partnerid === 'bluewallet' && req.body.accounttype)) return errorBadArguments(res); - + // Valid if the partnerid isn't there or is a string (same with accounttype) + if (! ( + (!req.body.partnerid || (typeof req.body.partnerid === 'string' || req.body.partnerid instanceof String)) + && (!req.body.accounttype || (typeof req.body.accounttype === 'string' || req.body.accounttype instanceof String)) + ) ) return errorBadArguments(res); + if (config.sunset) return errorSunset(res); let u = new User(redis, bitcoinclient, lightning);