diff --git a/.env.example b/.env.example index 19c9e0d2..08b086de 100644 --- a/.env.example +++ b/.env.example @@ -10,3 +10,4 @@ MAILGUN_PASSWORD=smtp_pass MAILGUN_USERNAME=postmaster@myawesomeapp.mailgun.org MAILGUN_API_KEY=key-mailgunapikey SECRET_TOKEN=secrettoken +DEVISE_SECRET_KEY=secrettoken diff --git a/Gemfile b/Gemfile index 00e4f802..aa651c81 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem 'unicorn' gem 'foreman' gem 'crowdtilt', github: 'Crowdtilt/crowdtilt-gem' -gem 'devise', '~> 3.0.0' +gem 'devise', '~> 3.1.0' gem 'nokogiri' gem 'friendly_id', '~> 4.0.9' gem 'iso_country_codes' diff --git a/Gemfile.lock b/Gemfile.lock index 8d0ad428..e33831b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,6 +45,7 @@ GEM asset_sync (0.5.4) activemodel fog + atomic (1.1.14) aws-sdk (1.11.0) json (~> 1.4) nokogiri (>= 1.4.4) @@ -73,10 +74,11 @@ GEM coffee-script-source execjs coffee-script-source (1.6.2) - devise (3.0.4) + devise (3.1.2) 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) dotenv (0.7.0) @@ -216,6 +218,8 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) thor (0.18.1) + thread_safe (0.1.3) + atomic tilt (1.4.1) treetop (1.4.14) polyglot @@ -246,7 +250,7 @@ DEPENDENCIES ckeditor coffee-rails (~> 3.2.1) crowdtilt! - devise (~> 3.0.0) + devise (~> 3.1.0) email_spec factory_girl_rails faker diff --git a/README.md b/README.md index eef8da00..366fb747 100644 --- a/README.md +++ b/README.md @@ -98,15 +98,15 @@ $ cp .env.example .env ``` -Then open up the .env file and fill in the variables with your app_name and credentials. Leave ```ENABLE_ASSET_SYNC``` set to 'true' if you plan to use AWS to host your assets (recommended). The bucket for asset syncing should be in the US Standard (us-east-1) zone. +Then open up the .env file and fill in the variables with your app_name and credentials. Leave `ENABLE_ASSET_SYNC` set to 'true' if you plan to use AWS to host your assets (recommended). The bucket for asset syncing should be in the US Standard (us-east-1) zone. -The ```SECRET_TOKEN``` variable should be at least 30 characters and all random, no regular words or you'll be exposed to dictionary attacks. You can generate a new one by running this command from the root of your project directory: +The `SECRET_TOKEN` and `DEVISE_SECRET_KEY` variables should be at least 30 characters and all random, no regular words or you'll be exposed to dictionary attacks. Do NOT reuse the same secret token - you'll need to generate it twice. You can generate a new one by running this command from the root of your project directory: ``` -$ rake secret +$ foreman run rake secret ``` -Important: Your ```APP_NAME``` must not have a space in it. Underscores and hypens are accepted. +Important: Your `APP_NAME` must not have a space in it. Underscores and hypens are accepted. ``` APP_NAME=myawesomeapp @@ -120,6 +120,7 @@ MAILGUN_DOMAIN=myawesomeapp.mailgun.org MAILGUN_PASSWORD=mailgunpassword MAILGUN_USERNAME=postmaster@myawesomeapp.mailgun.org SECRET_TOKEN=secrettoken +DEVISE_SECRET_KEY=secrettoken ``` Install the gems diff --git a/app/assets/stylesheets/devise.css.scss b/app/assets/stylesheets/devise.css.scss index 937028fa..dd375bbb 100644 --- a/app/assets/stylesheets/devise.css.scss +++ b/app/assets/stylesheets/devise.css.scss @@ -1,4 +1,4 @@ -#signin { +#devise-mini { padding: 50px 0; .well { @@ -24,25 +24,6 @@ } } -#signup { - padding: 50px 0; - - .well { - width: 400px; - margin: 0 auto; - padding: 35px; - - form { - margin-bottom: 0px; - - button { - display: inline-block; - margin: 10px 0px; - } - } - } -} - #error_explanation { h2 { margin-bottom: 0px; @@ -58,4 +39,4 @@ #password { padding: 50px 0; -} \ No newline at end of file +} diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index 5b04a725..36670f91 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 27130348..93de6d05 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 a4152e13..f59615fe 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/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 857ab143..005cdf67 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,18 +1,22 @@ -Please enter your email below.
-Change your password:
Please create an account to continue.
<% else %> -Looks like this is a new Crowdhoster App! Go ahead and create a user that will serve as your site admin:
<% end %> @@ -32,6 +31,5 @@Please sign in to continue.
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> @@ -26,6 +26,5 @@ Don't have an account? <%= link_to "Sign up", new_registration_path(resource_name) %>