Skip to content
Browse files

changed from accessing express request header using .get to using .he…

…aders and updated response to handleMessage
  • Loading branch information...
1 parent 3d930e9 commit ba8beab9274ec13e06c3fc82cb6c30dccdf9016a @jrandall jrandall committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 ep_sotauth.js
View
8 ep_sotauth.js
@@ -29,8 +29,8 @@ function sotauthSetUsername(token, username) {
exports.authenticate = function(hook_name, context, cb) {
console.debug('ep_sotauth.authenticate');
- if (context.req.get('x-forwarded-user')) {
- var username = context.req.get('x-forwarded-user');
+ if (context.req.headers['x-forwarded-user']) {
+ var username = context.req.headers['x-forwarded-user'];
var express_sid = context.req.sessionID;
console.debug('ep_sotauth.authenticate: have x-forwarded-user = %s for express_sid = %s', username, express_sid);
context.req.session.user = username;
@@ -60,9 +60,9 @@ exports.handleMessage = function(hook_name, context, cb) {
}
} else if( context.message.type == "COLLABROOM" && context.message.data.type == "USERINFO_UPDATE" ) {
console.debug('ep_sotauth.handleMessage: intercepted USERINFO_UPDATE and dropping it!');
- return null;
+ return cb([null]);
}
- return cb();
+ return cb([context.message]);
}

0 comments on commit ba8beab

Please sign in to comment.
Something went wrong with that request. Please try again.