Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Adding ugly hack to allow email verif. bypass
Browse files Browse the repository at this point in the history
This hack allow you to pass registrationWorkflowEnabled: false into the
createAccount function.
  • Loading branch information
swang committed Oct 7, 2013
1 parent 249db56 commit 1ca287a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -112,4 +121,4 @@ Application.prototype.verifyAccount = function(data, callback) {
}
}

module.exports = Application
module.exports = Application

0 comments on commit 1ca287a

Please sign in to comment.