Merge branch 'r-1902001-01' into foodcourt

This commit is contained in:
Thein Lin Kyaw
2020-07-11 04:00:55 +06:30
99 changed files with 2085 additions and 1781 deletions

View File

@@ -1,8 +1,8 @@
module LoginVerification
extend ActiveSupport::Concern
included do
before_action :authenticate_session_token
helper_method :current_company, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration, :current_shop
before_action :authenticate
helper_method :current_company, :current_shop, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration, :shop_detail
end
#this is base api base controller to need to inherit.
@@ -74,9 +74,10 @@ module LoginVerification
def authenticate_session_token
token = session[:session_token]
puts "token #{token}"
if (token)
#@current_user = User.find_by(api_key: token)
#Rails.logger.debug "token - " + token.to_s
# Rails.logger.debug "token - " + token.to_s
@user = Employee.authenticate_by_token(token)
if @user
return true
@@ -86,6 +87,6 @@ module LoginVerification
end
def render_unauthorized
redirect_to root_path
redirect_to login_path
end
end