Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

userId added to session after Oauth and Oauth2 logins.

  • Loading branch information...
commit 876dd988d0963530848c33a6e11b9fe9313e252d 1 parent 2ab9f4f
@bnoguchi authored
Showing with 2 additions and 14 deletions.
  1. +1 −7 lib/oauth.js
  2. +1 −7 lib/oauth2.js
View
8 lib/oauth.js
@@ -122,16 +122,10 @@ everyModule.submodule('oauth')
};
})
.addToSession( function (sess, auth) {
-// if (!sess.auth) sess.auth = {};
-// if (!sess.auth.userId) sess.auth.userId = user.id;
-// if (!sess.auth.fb) sess.auth.fb = {};
-// if (!sess.auth.fb.user) sess.auth.fb.user = fbData;
-// sess.auth.fb.access_token = cred.accessToken;
-// if (cred.refreshToken) sess.auth.fb.refresh_token = cred.refreshToken;
-
var _auth = sess.auth || (sess.auth = {})
, mod = _auth[this.name] || (_auth[this.name] = {});
_auth.loggedIn = true;
+ _auth.userId || (_auth.userId = auth.user.id);
mod.user = auth.oauthUser;
mod.accessToken = auth.accessToken;
mod.accessTokenSecret = auth.accessTokenSecret;
View
8 lib/oauth2.js
@@ -144,16 +144,10 @@ everyModule.submodule('oauth2')
return req.session;
})
.addToSession( function (sess, auth) {
-// if (!sess.auth) sess.auth = {};
-// if (!sess.auth.userId) sess.auth.userId = user.id;
-// if (!sess.auth.fb) sess.auth.fb = {};
-// if (!sess.auth.fb.user) sess.auth.fb.user = fbData;
-// sess.auth.fb.access_token = cred.accessToken;
-// if (cred.refreshToken) sess.auth.fb.refresh_token = cred.refreshToken;
-
var _auth = sess.auth || (sess.auth = {})
, mod = _auth[this.name] || (_auth[this.name] = {});
_auth.loggedIn = true;
+ _auth.userId || (_auth.userId = auth.user.id);
mod.user = auth.oauthUser;
mod.accessToken = auth.accessToken;
// this._super() ?
Please sign in to comment.
Something went wrong with that request. Please try again.