From 6a5c1648357886d6da6dbc71765d609916a2979b Mon Sep 17 00:00:00 2001 From: "gustavo.marin" Date: Tue, 27 Jan 2015 11:54:17 +0100 Subject: [PATCH] added config to skip OTP code on user creation --- config_sample.json | 1 + src/routes/userCreation.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/config_sample.json b/config_sample.json index 6181fe9..0b3b9e8 100644 --- a/config_sample.json +++ b/config_sample.json @@ -57,6 +57,7 @@ "expireInSec": 2 } }, + "usePinVerification": true, "userPIN": { "size": 4, "attempts": 3 diff --git a/src/routes/userCreation.js b/src/routes/userCreation.js index eeddaad..2de21eb 100644 --- a/src/routes/userCreation.js +++ b/src/routes/userCreation.js @@ -132,6 +132,10 @@ function createUserEndpoint(req, res, next) { } else { var pin = req.headers['x-otp-pin']; + if( config.usePinVerification === false ) { + return createUser(req, body, res, next, user); + } + if (!pin) { debug('no pin number'); phoneMng.createPIN(user.username, phone, function (err, createdPin) {