mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Include port number in token
This commit is contained in:
@@ -9,7 +9,9 @@ class AuthHandler < Kemal::Handler
|
||||
def call(env)
|
||||
return call_next(env) if request_path_startswith env, ["/login", "/logout"]
|
||||
|
||||
cookie = env.request.cookies.find { |c| c.name == "token" }
|
||||
cookie = env.request.cookies.find do |c|
|
||||
c.name == "token-#{Config.current.port}"
|
||||
end
|
||||
if cookie.nil? || !@storage.verify_token cookie.value
|
||||
return redirect env, "/login"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user