diff --git a/Gemfile b/Gemfile
index a9147cd..4910d22 100644
--- a/Gemfile
+++ b/Gemfile
@@ -34,7 +34,7 @@ gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
# For user authentication and everything else
-gem 'devise', '~> 3.0.0'
+gem 'devise', '~> 3.1.0'
# Kalibro integration
gem 'kalibro_entities', git: 'https://github.com/mezuro/kalibro_entities.git' #When the first version of KalibroEntities come out, do not keep using the git repository
diff --git a/Gemfile.lock b/Gemfile.lock
index c5c1ed4..9baca4a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -71,10 +71,11 @@ GEM
nokogiri (>= 1.5.0)
rails (>= 3.0.0)
database_cleaner (1.1.1)
- devise (3.0.3)
+ devise (3.1.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
+ thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.4)
erubis (2.7.0)
@@ -229,7 +230,7 @@ DEPENDENCIES
cucumber (= 1.3.2)
cucumber-rails (~> 1.4.0)
database_cleaner
- devise (~> 3.0.0)
+ devise (~> 3.1.0)
factory_girl_rails
jbuilder (~> 1.2)
jquery-rails
diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb
index 5b04a72..36670f9 100644
--- a/app/views/devise/mailer/confirmation_instructions.html.erb
+++ b/app/views/devise/mailer/confirmation_instructions.html.erb
@@ -2,4 +2,4 @@
You can confirm your account email through the link below:
-<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>
+<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %>
diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb
index 2713034..93de6d0 100644
--- a/app/views/devise/mailer/reset_password_instructions.html.erb
+++ b/app/views/devise/mailer/reset_password_instructions.html.erb
@@ -2,7 +2,7 @@
Someone has requested a link to change your password. You can do this through the link below.
-<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>
+<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %>
If you didn't request this, please ignore this email.
Your password won't change until you access the link above and create a new one.
diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb
index a4152e1..f59615f 100644
--- a/app/views/devise/mailer/unlock_instructions.html.erb
+++ b/app/views/devise/mailer/unlock_instructions.html.erb
@@ -4,4 +4,4 @@
Click the link below to unlock your account:
-<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %>
+<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %>
diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb
index eab783a..d84bdde 100644
--- a/app/views/devise/shared/_links.erb
+++ b/app/views/devise/shared/_links.erb
@@ -6,7 +6,7 @@
<%= link_to "Sign up", new_registration_path(resource_name) %>
<% end -%>
-<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %>
<% end -%>
@@ -22,4 +22,4 @@
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
<% end -%>
-<% end -%>
\ No newline at end of file
+<% end -%>
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index e9b8708..6f6a1fc 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -1,6 +1,11 @@
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
+ # The secret key used by Devise. Devise uses this key to generate
+ # random tokens. Changing this key will render invalid all existing
+ # confirmation, reset password and unlock tokens in the database.
+ config.secret_key = '24dea7d0a57b542793cd6ed3a05fd51178530c893524ab49f4c095f3d7c77483b00d09200aed92a194d073bf785fcbc96e5e7953ab3550e2e4aea41d117c06d6'
+
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
@@ -76,6 +81,12 @@ Devise.setup do |config|
# passing :skip => :sessions to `devise_for` in your config/routes.rb
config.skip_session_storage = [:http_auth]
+ # By default, Devise cleans up the CSRF token on authentication to
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
+ # requests for sign in and sign up, you need to get a new CSRF token
+ # from the server. You can disable this option at your own risk.
+ # config.clean_up_csrf_token_on_authentication = true
+
# ==> Configuration for :database_authenticatable
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
# using other encryptors, it sets how many times you want the password re-encrypted.
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
index d01f375..e7445b3 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/devise.en.yml
@@ -3,17 +3,18 @@
en:
devise:
confirmations:
- confirmed: "Your account was successfully confirmed. You are now signed in."
+ confirmed: "Your account was successfully confirmed. Please sign in."
+ confirmed_and_signed_in: "Your account was successfully confirmed. You are now signed in."
send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
failure:
already_authenticated: "You are already signed in."
- inactive: "Your account was not activated yet."
+ inactive: "Your account is not activated yet."
invalid: "Invalid email or password."
invalid_token: "Invalid authentication token."
locked: "Your account is locked."
not_found_in_database: "Invalid email or password."
- timeout: "Your session expired, please sign in again to continue."
+ timeout: "Your session expired. Please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your account before continuing."
mailer:
--
libgit2 0.21.2