Change login sessions

This commit is contained in:
calzoneman 2015-02-15 21:56:00 -06:00
parent b579db5310
commit 08a9eae2d3
1 changed files with 4 additions and 3 deletions

View File

@ -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,