Skip to content

Commit

Permalink
fix: this time make sure we use proper fields
Browse files Browse the repository at this point in the history
  • Loading branch information
AVVS committed Aug 18, 2016
1 parent e8ee45a commit aa827c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/actions/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function verifyChallenge(request) {
.get('id');

function activateAccount(data) {
const user = data.username;
const user = data[USERS_USERNAME_FIELD];
const alias = data[USERS_ALIAS_FIELD];
const userKey = redisKey(user, USERS_DATA);

Expand All @@ -81,7 +81,8 @@ function verifyChallenge(request) {
if (status === 'true') {
throw new Errors.HttpStatusError(417, `Account ${user} was already activated`);
}
});
})
.return(user);
}

function hook(user) {
Expand All @@ -92,8 +93,7 @@ function verifyChallenge(request) {
.bind(this, username)
.then(username ? userExists : verifyToken)
.then(getInternalData)
.get(USERS_USERNAME_FIELD)
.tap(activateAccount)
.then(activateAccount)
.tap(hook)
.then(user => [user, audience])
.spread(jwt.login);
Expand Down

0 comments on commit aa827c7

Please sign in to comment.