cloud for api and doemal

This commit is contained in:
Yan
2018-04-11 11:27:05 +06:30
parent 70cd6576b1
commit 04ae741462
5 changed files with 60 additions and 8 deletions

View File

@@ -56,6 +56,21 @@ class MyAesCrypt
return aes_key, aes_iv
end
def checkKeyForAuth(from,token){
file_path = "config/shops.json"
shop_data = File.read(file_path)
shop_json = JSON.parse(shop_data)
shop_json["data"].each do |j|
if j["lookup"] == from
if(j["value"]["key"] == token){
return true
}
end
end
return false
}
private
def encrypt(data)
cipher.encrypt