license and local move to base action and update other base

This commit is contained in:
Yan
2018-02-27 11:41:24 +06:30
parent 13b7b1f800
commit ac470c5747
9 changed files with 77 additions and 64 deletions

View File

@@ -7,7 +7,8 @@ class ApplicationController < ActionController::Base
# lookup domain for db from provision
# before_action :set_locale
helper_method :current_company,:current_login_employee,:current_user
# helper_method :current_company,:current_login_employee,:current_user
# alias_method :current_user, :current_login_employee,:current_user
#this is base api base controller to need to inherit.
#all token authentication must be done here
@@ -18,6 +19,7 @@ class ApplicationController < ActionController::Base
redirect_to root_path
end
private
def current_user
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end
@@ -36,7 +38,7 @@ class ApplicationController < ActionController::Base
end
def current_login_employee
def current_login_employee
if (!session[:session_token].nil?)
@employee = Employee.find_by_token_session(session[:session_token])
end