mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Clean up
This commit is contained in:
parent
6ad4385b18
commit
6817113523
@ -15,7 +15,6 @@ class AuthHandler < Kemal::Handler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def require_basic_auth(env)
|
def require_basic_auth(env)
|
||||||
headers = HTTP::Headers.new
|
|
||||||
env.response.status_code = 401
|
env.response.status_code = 401
|
||||||
env.response.headers["WWW-Authenticate"] = HEADER_LOGIN_REQUIRED
|
env.response.headers["WWW-Authenticate"] = HEADER_LOGIN_REQUIRED
|
||||||
env.response.print AUTH_MESSAGE
|
env.response.print AUTH_MESSAGE
|
||||||
@ -59,9 +58,8 @@ class AuthHandler < Kemal::Handler
|
|||||||
|
|
||||||
def handle_opds_auth(env)
|
def handle_opds_auth(env)
|
||||||
if validate_cookie_token(env) || validate_auth_header(env)
|
if validate_cookie_token(env) || validate_auth_header(env)
|
||||||
return call_next env
|
call_next env
|
||||||
else
|
else
|
||||||
headers = HTTP::Headers.new
|
|
||||||
env.response.status_code = 401
|
env.response.status_code = 401
|
||||||
env.response.headers["WWW-Authenticate"] = HEADER_LOGIN_REQUIRED
|
env.response.headers["WWW-Authenticate"] = HEADER_LOGIN_REQUIRED
|
||||||
env.response.print AUTH_MESSAGE
|
env.response.print AUTH_MESSAGE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user