From 3b2baa8c9d69809f9cbfecae7d089e9331308744 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 30 Sep 2013 04:14:10 +0200 Subject: [PATCH] Needed to sets session.user_id in controller. --- app/controllers/sessions_controller.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index c509e87a3..16cf989ca 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -14,15 +14,6 @@ class SessionsController < ApplicationController return end - # set session user - current_user_set(user) - - # log new session - user.activity_stream_log( 'session started', user.id ) - - # auto population of default collections - default_collection = SessionHelper::default_collections(user) - # remember me - set session cookie to expire later if params[:remember_me] request.env['rack.session.options'][:expire_after] = 1.year @@ -33,6 +24,16 @@ class SessionsController < ApplicationController # request.env['rack.session.options'][:renew] = true # reset_session + # set session user + session[:user_id] = user.id + current_user_set(user) + + # log new session + user.activity_stream_log( 'session started', user.id ) + + # auto population of default collections + default_collection = SessionHelper::default_collections(user) + # set session user_id user = User.find_fulldata(user.id) @@ -128,6 +129,7 @@ class SessionsController < ApplicationController end # set current session user + session[:user_id] = authorization.user.id current_user_set(authorization.user) # log new session @@ -147,6 +149,7 @@ class SessionsController < ApplicationController if user # set current session user + session[:user_id] = user.id current_user_set(user) # log new session