diff --git a/models/u2f.js b/models/u2f.js index e5f0001..8e1e427 100644 --- a/models/u2f.js +++ b/models/u2f.js @@ -116,6 +116,11 @@ module.exports.createRegistration = (apiKeyValue, apiSecret, {appId} = {}, callb return; } + if ((!appId) || typeof appId !== 'string') { + response.returnError(400, 'appId is required', callback); + return; + } + const registrationRequest = u2f.request(appId); const u2fUuid = uuid.v4();