From 1ca287ad2e4901fae415d297ad09186a21d290df Mon Sep 17 00:00:00 2001 From: Shuan Wang Date: Mon, 7 Oct 2013 12:52:02 -0700 Subject: [PATCH] Adding ugly hack to allow email verif. bypass This hack allow you to pass registrationWorkflowEnabled: false into the createAccount function. --- lib/application.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/application.js b/lib/application.js index c722dea..9e0f690 100644 --- a/lib/application.js +++ b/lib/application.js @@ -36,7 +36,16 @@ Application.prototype.getPasswordResetTokens = function(resetToken) { } Application.prototype.createAccount = function(data, callback) { - this.request('POST', ['applications', this.id, 'accounts'], data, callback) + var uri = ['applications', this.id, 'accounts'] + , workflow + + // ugly hack + if (data.registrationWorkflowEnabled !== null) { + workflow = "?registrationWorkflowEnabled=" + data.registrationWorkflowEnabled + uri.push(workflow) + delete data.registrationWorkflowEnabled + } + this.request('POST', uri, data, callback) } Application.prototype.createGroup = function(data, callback) { @@ -112,4 +121,4 @@ Application.prototype.verifyAccount = function(data, callback) { } } -module.exports = Application \ No newline at end of file +module.exports = Application