update token mismatch

This commit is contained in:
Yan
2018-02-23 15:49:29 +06:30
parent 25a212bb70
commit a6abfb2f49
10 changed files with 21 additions and 27 deletions

View File

@@ -6,6 +6,21 @@ module LoginVerification
helper_method :current_company,:current_login_employee
end
#this is base api base controller to need to inherit.
#all token authentication must be done here
#response format must be set to JSON
def current_company
begin
return Company.first
rescue
return nil
end
end
def current_login_employee
@employee = Employee.find_by_token_session(session[:session_token])
end
protected
# Authenticate the user with token based authentication
@@ -34,23 +49,6 @@ module LoginVerification
redirect_to root_path
end
#this is base api base controller to need to inherit.
#all token authentication must be done here
#response format must be set to JSON
def current_company
begin
return Company.first
rescue
return nil
end
end
def current_login_employee
@employee = Employee.find_by_token_session(session[:session_token])
end
private
def check_license
License.check_license_file