Skip to content

Commit

Permalink
Assign oauth user to session earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoguchi committed Jun 6, 2013
1 parent b909b35 commit fd80c41
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/modules/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ everyModule.submodule('oauth')
.step('fetchOAuthUser')
.accepts('accessToken accessTokenSecret params')
.promises('oauthUser')
.step('assignOAuthUserToSession')
.accepts('oauthUser session')
.promises('session')
.step('findOrCreateUser')
.accepts('session accessToken accessTokenSecret oauthUser')
.promises('user')
Expand Down Expand Up @@ -192,6 +195,10 @@ everyModule.submodule('oauth')
});
return promise;
})
.assignOAuthUserToSession( function (oauthUser, session) {
session.auth[this.name].user = oauthUser;
return session;
})
.compileAuth( function (accessToken, accessTokenSecret, oauthUser, user) {
return {
accessToken: accessToken
Expand Down

0 comments on commit fd80c41

Please sign in to comment.