Skip to content

Commit 6b3b251

Browse files
authored
Merge pull request #52 from Simperium/update/signup-protocol
Allow an optional 'provider' param to be passed when creating a user.
2 parents a050c7b + 2b563b0 commit 6b3b251

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simperium",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"description": "A simperium client for node.js",
55
"main": "./lib/simperium/index.js",
66
"repository": {

src/simperium/auth.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ Auth.prototype.authorize = function( username, password ) {
2020
return promise;
2121
}
2222

23-
Auth.prototype.create = function( username, password ) {
24-
var body = JSON.stringify( { username: username, password: password } ),
25-
promise = this.request( 'create/', body );
23+
Auth.prototype.create = function( username, password, provider ) {
24+
var userData = { username, password };
25+
if ( provider ) {
26+
userData.provider = provider;
27+
}
28+
var body = JSON.stringify( userData ),
29+
promise = this.request( 'create/', body );
2630

2731
return promise;
2832
}

0 commit comments

Comments
 (0)