Refactor admin slice routing and auth
This commit is contained in:
@@ -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
|
Reference in New Issue
Block a user