Refactor admin slice routing and auth

This commit is contained in:
2023-07-25 21:35:01 +10:00
parent 917bf808c1
commit 6071f824c3
4 changed files with 72 additions and 63 deletions

View File

@@ -1,16 +0,0 @@
module Adamantium
module Middleware
class BasicAuth < Rack::Auth::Basic
def call(env)
request = Rack::Request.new(env)
if /^\/admin*/.match?(request.path)
# Execute basic authentication
super(env)
else
# Pass basic authentication
@app.call(env)
end
end
end
end
end