Permalink
Browse files

step 2; Getting the Currently Logged In User

  • Loading branch information...
vkarpov15 committed Jul 29, 2015
1 parent ecdc101 commit 78d16c1fd1d10437c8eff6e9fcdd94f01a855bd8
Showing with 19 additions and 2 deletions.
  1. +2 −0 package.json
  2. +7 −0 server/boot/authentication.js
  3. +10 −2 server/middleware.json
View
@@ -7,8 +7,10 @@
},
"dependencies": {
"compression": "^1.0.3",
"cookie-parser": "^1.3.5",
"cors": "^2.5.2",
"errorhandler": "^1.1.1",
"express-session": "^1.11.3",
"loopback": "^2.14.0",
"loopback-boot": "^2.6.5",
"loopback-component-passport": "^1.5.0",
@@ -1,4 +1,11 @@
var loopback = require('loopback');
module.exports = function enableAuthentication(server) {
// enable authentication
server.enableAuth();
server.middleware('auth', loopback.token({
model: server.models.accessToken,
currentUserLiteral: 'me'
}));
};
View
@@ -12,9 +12,17 @@
}
}
},
"session": {
"session:before": {
"cookie-parser": { "params": "test secret" }
},
"auth": {
"session": {
"express-session": {
"params": {
"secret": "other test secret",
"saveUninitialized": true,
"resave": true
}
}
},
"parse": {
},

0 comments on commit 78d16c1

Please sign in to comment.