diff options
author | Azul <azul@leap.se> | 2012-12-07 08:28:23 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-12-07 08:28:23 +0100 |
commit | 1ec55c4f562a4fdd57c50077ff286ef08e9978a1 (patch) | |
tree | 16203d2ca4f32e24d38fef6062aa9534cecb3bfe /users/config | |
parent | effa6b0f84cfe954cc9dd73f592663b743b0d857 (diff) | |
parent | a3dce077881c7e97090e5e560b1fb004952d5b23 (diff) |
Merge branch 'develop'
Diffstat (limited to 'users/config')
-rw-r--r-- | users/config/initializers/add_controller_methods.rb | 3 | ||||
-rw-r--r-- | users/config/initializers/warden.rb | 7 | ||||
-rw-r--r-- | users/config/locales/en.yml | 14 | ||||
-rw-r--r-- | users/config/routes.rb | 8 |
4 files changed, 28 insertions, 4 deletions
diff --git a/users/config/initializers/add_controller_methods.rb b/users/config/initializers/add_controller_methods.rb new file mode 100644 index 0000000..2579176 --- /dev/null +++ b/users/config/initializers/add_controller_methods.rb @@ -0,0 +1,3 @@ +ActiveSupport.on_load(:application_controller) do + include ControllerExtension::Authentication +end diff --git a/users/config/initializers/warden.rb b/users/config/initializers/warden.rb new file mode 100644 index 0000000..45feb6c --- /dev/null +++ b/users/config/initializers/warden.rb @@ -0,0 +1,7 @@ +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/users/config/locales/en.yml b/users/config/locales/en.yml new file mode 100644 index 0000000..1260494 --- /dev/null +++ b/users/config/locales/en.yml @@ -0,0 +1,14 @@ +en: + signup: "Sign up" + signup_message: "Please create an account." + cancel: "Cancel" + login: "Login" + login_message: "Please login with your account." + wrong_password: "wrong password" + user_not_found: "could not be found" + + activemodel: + models: + user: + one: User + other: "%{count} Users" diff --git a/users/config/routes.rb b/users/config/routes.rb index cfc0407..1d144b4 100644 --- a/users/config/routes.rb +++ b/users/config/routes.rb @@ -1,10 +1,10 @@ Rails.application.routes.draw do - get "log_in" => "sessions#new", :as => "log_in" - get "log_out" => "sessions#destroy", :as => "log_out" + get "login" => "sessions#new", :as => "login" + get "logout" => "sessions#destroy", :as => "logout" resources :sessions, :only => [:new, :create, :update, :destroy] - get "sign_up" => "users#new", :as => "sign_up" - resources :users, :only => [:new, :create] + get "signup" => "users#new", :as => "signup" + resources :users end |