Add endpoint /api/login

This commit is contained in:
Alex Ling
2021-10-08 10:07:40 +00:00
parent 8a732804ae
commit 80344c3bf0
2 changed files with 27 additions and 3 deletions
+3 -2
View File
@@ -54,8 +54,9 @@ class AuthHandler < Kemal::Handler
end
def call(env)
# Skip all authentication if requesting /login, /logout, or a static file
if request_path_startswith(env, ["/login", "/logout"]) ||
# Skip all authentication if requesting /login, /logout, /api/login,
# or a static file
if request_path_startswith(env, ["/login", "/logout", "/api/login"]) ||
requesting_static_file env
return call_next(env)
end