Restrict access to admin functions by IP

There are many possible ways to implement this feature:

* Adding a custom middleware
* Using rack-attack with a blocklist
* Using routes constraints

We're choosing to use a controller concern with a redirect because it's
what we do to handle unauthorized cancancan exceptions.
This commit is contained in:
CoslaJohn
2024-07-22 17:15:39 +01:00
committed by Javi Martín
parent 07202fea10
commit 424cedc0c8
8 changed files with 175 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
class Admin::BaseController < ApplicationController
include IpDeniedHandler
layout "admin"
before_action :authenticate_user!