mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Fix incorrect login redirect (#64)
This commit is contained in:
@@ -63,7 +63,10 @@ class AuthHandler < Kemal::Handler
|
||||
end
|
||||
|
||||
def handle_auth(env)
|
||||
return call_next(env) if request_path_startswith env, ["/login", "/logout"]
|
||||
if request_path_startswith env, ["/login", "/logout"] ||
|
||||
requesting_static_file env
|
||||
return call_next(env)
|
||||
end
|
||||
|
||||
unless validate_token env
|
||||
env.session.string "callback", env.request.path
|
||||
|
||||
@@ -16,10 +16,8 @@ class FS
|
||||
end
|
||||
|
||||
class StaticHandler < Kemal::Handler
|
||||
@dirs = ["/css", "/js", "/img", "/favicon.ico"]
|
||||
|
||||
def call(env)
|
||||
if request_path_startswith env, @dirs
|
||||
if requesting_static_file env
|
||||
file = FS.get? env.request.path
|
||||
return call_next env if file.nil?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user