mirror of
https://github.com/Thream/socketio-jwt.git
synced 2024-07-21 09:38:31 +02:00
step 1
This commit is contained in:
parent
2d257bfb1e
commit
f31dc4a93e
@ -35,13 +35,13 @@ function authorize(options) {
|
||||
|
||||
return function(data, accept){
|
||||
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] = {
|
||||
logged_in: false
|
||||
};
|
||||
|
||||
if(data.xdomain)
|
||||
return auth.fail(data, 'Can not read cookies from CORS-Requests.', false, accept);
|
||||
if(data.xdomain && !data.sessionID)
|
||||
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){
|
||||
if(err)
|
||||
|
Loading…
Reference in New Issue
Block a user