Skip to content

Commit

Permalink
always return a user object from register
Browse files Browse the repository at this point in the history
  • Loading branch information
harrymoore committed Jun 7, 2017
1 parent 4cdf391 commit 93141d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/controllers.js
Expand Up @@ -139,14 +139,15 @@ var handleRegister = function(req, res)
"email": form.email,
"password": form.password
}).then(function() {
var user = this;

// add the user to the "appusers" team for the stack
var teamKey = "appusers-" + gitana.application().getId();
Chain(gitana.stack()).trap(errHandler).readTeam(teamKey).addMember(this).then(function() {
Chain(gitana.stack()).trap(errHandler).readTeam(teamKey).addMember(user).then(function() {

res.send({
"ok": true,
"user": this
"user": user
});

});
Expand Down

0 comments on commit 93141d4

Please sign in to comment.