This commit is contained in:
Screeny 2013-11-19 10:45:09 +01:00
parent 2d257bfb1e
commit f31dc4a93e

View File

@ -35,13 +35,13 @@ function authorize(options) {
return function(data, accept){ return function(data, accept){
data.cookie = parseCookie(auth, data.headers.cookie || ''); data.cookie = parseCookie(auth, data.headers.cookie || '');
data.sessionID = data.cookie[auth.key] || ''; data.sessionID = data.query.session_id || data.cookie[auth.key] || '';
data[auth.userProperty] = { data[auth.userProperty] = {
logged_in: false logged_in: false
}; };
if(data.xdomain) if(data.xdomain && !data.sessionID)
return auth.fail(data, 'Can not read cookies from CORS-Requests.', false, accept); return auth.fail(data, 'Can not read cookies from CORS-Requests. See CORS-Workaround in the readme.', false, accept);
auth.store.get(data.sessionID, function(err, session){ auth.store.get(data.sessionID, function(err, session){
if(err) if(err)