making sure this is up to date
This commit is contained in:
@@ -9,7 +9,10 @@ class ApplicationController < ActionController::Base
|
||||
private
|
||||
|
||||
def current_user
|
||||
@current_user ||= (User.find_by_auth_token(cookies[:auth_token].to_s) || User.find_by_user_id(session[:user_id].to_s))
|
||||
@current_user ||= (
|
||||
User.find_by_auth_token(cookies[:auth_token].to_s) ||
|
||||
User.find_by_user_id(session[:user_id].to_s)
|
||||
)
|
||||
end
|
||||
|
||||
def authenticated
|
||||
|
||||
@@ -8,7 +8,6 @@ class SessionsController < ApplicationController
|
||||
redirect_to home_dashboard_index_path if current_user
|
||||
end
|
||||
|
||||
|
||||
def create
|
||||
path = params[:url].present? ? params[:url] : home_dashboard_index_path
|
||||
begin
|
||||
@@ -20,10 +19,9 @@ class SessionsController < ApplicationController
|
||||
|
||||
if user
|
||||
if params[:remember_me]
|
||||
cookies.permanent[:auth_token] = user.auth_token if User.where(:user_id => user.user_id).exists?
|
||||
cookies.permanent[:auth_token] = user.auth_token if User.where(:user_id => user.user_id).exists?
|
||||
else
|
||||
session[:user_id] = user.user_id if User.where(:user_id => user.user_id).exists?
|
||||
#cookies[:auth_token] = user.auth_token if User.where(:user_id => user.user_id).exists?
|
||||
end
|
||||
redirect_to path
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user