We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local function check_login() return function(req, res, next) local requestPath = req.path local in_white_list = false if requestPath == "/auth/login" then in_white_list = true end local islogin, user= is_login(req) --这一段还没登录就去获取session,导致session.lua一直报错 if in_white_list then next() else if islogin then res.locals.login = islogin res.locals.username = user and user.username next() else res:redirect("/auth/login") end end end end
2021/02/26 00:14:43 [error] 1889#0: *1884 [lua] session.lua:85: func(): cannot get session_data:no cookie found in the current request, client: 192.168.0.130, server: 192.168.0.111, request: "POST /auth/login HTTP/1.1", host: "192.168.0.111", referrer: "http://192.168.0.111/auth/login" 2021/02/26 00:14:49 [error] 1889#0: *1884 [lua] session.lua:85: func(): cannot get session_data:no cookie found in the current request, client: 192.168.0.130, server: 192.168.0.111, request: "GET /auth/login HTTP/1.1", host: "192.168.0.111" 2021/02/26 00:14:58 [error] 1889#0: *1888 [lua] session.lua:85: func(): cannot get session_data:no cookie found in the current request, client: 192.168.0.130, server: 192.168.0.111, request: "POST /auth/login HTTP/1.1", host: "192.168.0.111", referrer: "http://192.168.0.111/auth/login"
第一次提issues希望没提错,
The text was updated successfully, but these errors were encountered:
No branches or pull requests
第一次提issues希望没提错,
The text was updated successfully, but these errors were encountered: