14 lines
507 B
Lua
14 lines
507 B
Lua
|
local session, err, exists = require "resty.session".open()
|
||
|
if exists and session:get("authenticated") then
|
||
|
ngx.log(ngx.INFO, session:get("account"), " 访问")
|
||
|
else
|
||
|
local server = ""
|
||
|
if ngx.var.server_port == "80" then
|
||
|
server = ngx.var.host
|
||
|
else
|
||
|
server = ngx.var.host .. ":" .. ngx.var.server_port
|
||
|
end
|
||
|
local target_url = ngx.var.scheme .. "://" .. server .. ngx.var.request_uri
|
||
|
ngx.redirect('https://amass.fun/LoginPage?next=' .. ngx.escape_uri(target_url))
|
||
|
end
|