[Web] move /process/login to internal endpoint

This commit is contained in:
FreddleSpl0it
2023-04-12 15:32:22 +02:00
parent 4b2e996c6f
commit 2f97e6efe8
10 changed files with 123 additions and 58 deletions

View File

@@ -152,13 +152,14 @@ function auth_password_verify(request, password)
-- check against mailbox passwds
local b, c = https.request {
method = "POST",
url = "https://nginx/api/v1/process/login",
url = "https://nginx:9082",
source = ltn12.source.string(req_json),
headers = {
["content-type"] = "application/json",
["content-length"] = tostring(#req_json)
},
sink = ltn12.sink.table(res)
sink = ltn12.sink.table(res),
insecure = true
}
local api_response = json.decode(table.concat(res))
if api_response.role == 'user' then
@@ -182,13 +183,14 @@ function auth_password_verify(request, password)
local b, c = https.request {
method = "POST",
url = "https://nginx/api/v1/process/login",
url = "https://nginx:9082",
source = ltn12.source.string(req_json),
headers = {
["content-type"] = "application/json",
["content-length"] = tostring(#req_json)
},
sink = ltn12.sink.table(res)
sink = ltn12.sink.table(res),
insecure = true
}
local api_response = json.decode(table.concat(res))
if api_response.role == 'user' then