Skip to content

Commit 8bc5fca

Browse files
committed
Add ability to create users.
1 parent dc804e2 commit 8bc5fca

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/simperium/auth.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ export default function Auth( appId, appSecret ) {
1414
inherits( Auth, EventEmitter );
1515

1616
Auth.prototype.authorize = function( username, password ) {
17-
var body = JSON.stringify( {username: username, password: password } ),
17+
var body = JSON.stringify( { username: username, password: password } ),
1818
promise = this.request( 'authorize/', body );
1919

2020
return promise;
2121
}
2222

23-
// TODO: username and password to create a user
24-
Auth.prototype.create = function() {
23+
Auth.prototype.create = function( username, password ) {
24+
var body = JSON.stringify( { username: username, password: password } ),
25+
promise = this.request( 'create/', body );
2526

27+
return promise;
2628
}
2729

2830
Auth.prototype.getUrlOptions = function( path ) {

0 commit comments

Comments
 (0)