mirror of https://github.com/calzoneman/sync.git
Change login sessions
This commit is contained in:
parent
b579db5310
commit
08a9eae2d3
|
@ -1,10 +1,10 @@
|
|||
var sio = require("socket.io");
|
||||
var cookieParser = require("cookie-parser")();
|
||||
var Logger = require("../logger");
|
||||
var db = require("../database");
|
||||
var User = require("../user");
|
||||
var Server = require("../server");
|
||||
var Config = require("../config");
|
||||
var cookieParser = require("cookie-parser")(Config.get("http.cookie-secret"));
|
||||
var $util = require("../utilities");
|
||||
var Flags = require("../flags");
|
||||
var Account = require("../account");
|
||||
|
@ -13,6 +13,7 @@ var net = require("net");
|
|||
var util = require("../utilities");
|
||||
var crypto = require("crypto");
|
||||
var isTorExit = require("../tor").isTorExit;
|
||||
var session = require("../session");
|
||||
|
||||
var CONNECT_RATE = {
|
||||
burst: 5,
|
||||
|
@ -32,8 +33,8 @@ function handleAuth(socket, accept) {
|
|||
socket.user = false;
|
||||
if (data.headers.cookie) {
|
||||
cookieParser(data, null, function () {
|
||||
var auth = data.cookies.auth;
|
||||
db.users.verifyAuth(auth, function (err, user) {
|
||||
var auth = data.signedCookies.auth;
|
||||
session.verifySession(auth, function (err, user) {
|
||||
if (!err) {
|
||||
socket.user = {
|
||||
name: user.name,
|
||||
|
|
Loading…
Reference in New Issue