summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-08 14:22:56 +0200
committerAzul <azul@leap.se>2014-04-08 14:30:07 +0200
commit9776dd10fc60efde38946588d0955c406f6c1f5e (patch)
treea77a83984e39a72cd1bb2f8f89c6d9646de117d7 /config/initializers
parentb6d14dc19dd350a807826e3e097738a36613e083 (diff)
move users: config and lib
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/add_controller_methods.rb4
-rw-r--r--config/initializers/error_constants.rb3
-rw-r--r--config/initializers/warden.rb10
-rw-r--r--config/initializers/webfinger.rb1
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'