cloud for api and doemal
This commit is contained in:
@@ -15,8 +15,15 @@ module TokenVerification
|
||||
|
||||
def authenticate_token
|
||||
authenticate_with_http_token do |token, options|
|
||||
#@current_user = User.find_by(api_key: token)
|
||||
Rails.logger.debug "token - " + token.to_s
|
||||
# Rails.logger.debug "token - " + token.to_s
|
||||
if(!options.from.nil? && options.from == "DOEMAL"){
|
||||
if(ENV["SERVER_MODE"] === "cloud"){
|
||||
from = request.subdomain.downcase + "." + request.domain.downcase
|
||||
aes = MyAesCrypt.new
|
||||
return aes.checkKeyForAuth(from, token)
|
||||
}
|
||||
}
|
||||
|
||||
@user = Employee.authenticate_by_token(token)
|
||||
if @user
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user