This commit is contained in:
Myat Zin Wai Maw
2019-12-04 13:33:13 +06:30
parent 15361fe4e1
commit 08f5689841
28 changed files with 314 additions and 100 deletions

View File

@@ -9,18 +9,18 @@ module TokenVerification
protected
# Authenticate the user with token based authentication
def authenticate
def authenticate
authenticate_token || render_unauthorized
end
def authenticate_token
authenticate_with_http_token do |token, options|
authenticate_with_http_token do |token, options|
# Rails.logger.debug "token - " + token.to_s
if(options.length !=0 && options["from"] == "DOEMAL")
if(ENV["SERVER_MODE"] === "cloud")
from = request.subdomain.downcase + "." + request.domain.downcase #"local"
aes = MyAesCrypt.new
return aes.checkKeyForAuth(from, token)
return aes.checkKeyForAuth(from, token)
end
end