diff options
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/add_controller_methods.rb | 4 | ||||
-rw-r--r-- | config/initializers/error_constants.rb | 3 | ||||
-rw-r--r-- | config/initializers/warden.rb | 10 | ||||
-rw-r--r-- | config/initializers/webfinger.rb | 1 |
4 files changed, 18 insertions, 0 deletions
diff --git a/config/initializers/add_controller_methods.rb b/config/initializers/add_controller_methods.rb new file mode 100644 index 0000000..f572ecb --- /dev/null +++ b/config/initializers/add_controller_methods.rb @@ -0,0 +1,4 @@ +ActiveSupport.on_load(:application_controller) do + include ControllerExtension::Authentication + include ControllerExtension::TokenAuthentication +end diff --git a/config/initializers/error_constants.rb b/config/initializers/error_constants.rb new file mode 100644 index 0000000..fdd3624 --- /dev/null +++ b/config/initializers/error_constants.rb @@ -0,0 +1,3 @@ +require 'ruby-srp' + +WRONG_PASSWORD = SRP::WrongPassword diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb new file mode 100644 index 0000000..22892b3 --- /dev/null +++ b/config/initializers/warden.rb @@ -0,0 +1,10 @@ +require "warden/session_serializer" +require "warden/strategies/secure_remote_password" + +Rails.configuration.middleware.use RailsWarden::Manager do |config| + config.default_strategies :secure_remote_password + config.failure_app = SessionsController +end + +RailsWarden.unauthenticated_action = :new + diff --git a/config/initializers/webfinger.rb b/config/initializers/webfinger.rb new file mode 100644 index 0000000..197062c --- /dev/null +++ b/config/initializers/webfinger.rb @@ -0,0 +1 @@ +require 'webfinger' |