simple
This commit is contained in:
parent
a3a5d6fa88
commit
a03b21107a
|
@ -25,23 +25,24 @@ set $skynet_proof '';
|
|||
set $limit_rate 0;
|
||||
|
||||
access_by_lua_block {
|
||||
-- if require("skynet.account").accounts_enabled() then
|
||||
-- -- check if portal is in authenticated only mode
|
||||
-- if require("skynet.account").is_access_unauthorized() then
|
||||
-- return require("skynet.account").exit_access_unauthorized()
|
||||
-- end
|
||||
--
|
||||
local accounts = require("skynet.account")
|
||||
if accounts.accounts_enabled() then
|
||||
-- check if portal is in authenticated only mode
|
||||
if accounts.is_access_unauthorized() then
|
||||
return accounts.exit_access_unauthorized()
|
||||
end
|
||||
|
||||
-- -- check if portal is in subscription only mode
|
||||
-- if require("skynet.account").is_access_forbidden() then
|
||||
-- return require("skynet.account").exit_access_forbidden()
|
||||
-- if accounts.is_access_forbidden() then
|
||||
-- return accounts.exit_access_forbidden()
|
||||
-- end
|
||||
--
|
||||
-- -- get account limits of currently authenticated user
|
||||
-- local limits = require("skynet.account").get_account_limits()
|
||||
-- local limits = accounts.get_account_limits()
|
||||
--
|
||||
-- -- apply download speed limit
|
||||
-- ngx.var.limit_rate = limits.download
|
||||
-- end
|
||||
end
|
||||
-- -- the block below only makes sense if we are using nginx cache
|
||||
-- if not ngx.var.skyd_disk_cache_enabled then
|
||||
-- local httpc = require("resty.http").new()
|
||||
|
|
Reference in New Issue