Skip to content

Commit

Permalink
0.8.1 Bump. Ключ куки для сессии регенерируется только при логине
Browse files Browse the repository at this point in the history
  • Loading branch information
klimashkin committed Jul 20, 2013
1 parent 34c5312 commit 1ccceb1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions controllers/_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ function generate(data, cb) {
return session;
}

function regen(session, data, cb) {
function regen(session, data, keyRegen, cb) {
'use strict';

session.key = Utils.randomString(12); // При каждом заходе регенерируем ключ
if (keyRegen) {
session.key = Utils.randomString(12); // При каждом заходе регенерируем ключ (пока только при логине)
}
session.stamp = new Date(); // При каждом заходе продлеваем действие ключа
if (data) {
_.assign(session.data, data);
Expand Down
2 changes: 1 addition & 1 deletion controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function login(socket, data, cb) {
uaData = {b: uaParsed.ua.family, bv: uaParsed.ua.toVersionString(), os: uaParsed.os.toString(), d: uaParsed.device.family};

session.user = user;
_session.regen(session, {remember: data.remember, ua: uaData},function (err, session) {
_session.regen(session, {remember: data.remember, ua: uaData}, true, function (err, session) {
_session.emitCookie(socket);
cb(session, {message: "Success login", youAre: user});
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pastvu",
"version": "0.8.1-dev",
"version": "0.8.1",
"description": "Retrospective topography of media content",
"homepage": "https://github.com/klimashkin/pastvu",
"keywords": ["oldmos", "pastvu"],
Expand Down
1 change: 1 addition & 0 deletions public/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

* (added) Футер страницы
* (fixed) Роли в информации о пользователе
* (fixed) Правка сессии
***
Полный список изменений: https://github.com/klimashkin/pastvu/compare/0.8.0...0.8.1

Expand Down
2 changes: 1 addition & 1 deletion public/js/lib/require/plugins/require-css/css-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ define(['require', './normalize'], function(req, normalize) {
var _cssBuffer = [];
cssAPI.write = function(pluginName, moduleName, write, parse) {
//external URLS don't get added (just like JS requires)
if (moduleName.substr(0, 7) == 'http://' || moduleName.substr(0, 8) == 'https://')
if (moduleName.substr(0, 7) == 'http://' || moduleName.substr(0, 8) == 'https://' || moduleName.substr(0, 2) == '//')
return;

var resourceName = moduleName + (!parse ? '.css' : '.less');
Expand Down
2 changes: 1 addition & 1 deletion views/module/common/foot.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.foot.fringe(data-bind="with: repository[M!M]")
.rightSide.hide-text
.footElem.strokeAfter(data-bind="click: showAbout") About
.footElem.strokeAfter(data-bind="click: showAbout") О проекте
.footElem.copyright
| PastVu
i.icon-white.icon-globe
Expand Down

0 comments on commit 1ccceb1

Please sign in to comment.