-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to devise 3.1 and unify the layouts for devise related views
- Loading branch information
Showing
17 changed files
with
94 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ MAILGUN_PASSWORD=smtp_pass | |
MAILGUN_USERNAME=[email protected] | ||
MAILGUN_API_KEY=key-mailgunapikey | ||
SECRET_TOKEN=secrettoken | ||
DEVISE_SECRET_KEY=secrettoken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
[email protected] | ||
SECRET_TOKEN=secrettoken | ||
DEVISE_SECRET_KEY=secrettoken | ||
``` | ||
|
||
Install the gems | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
<div id="password"> | ||
<div class="container content_box clearfix"> | ||
<h3>Change your password</h3> | ||
<div id="devise-mini"> | ||
<div class="container"> | ||
<div class="well"> | ||
|
||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= f.hidden_field :reset_password_token %> | ||
<h3>Change your password</h3> | ||
|
||
<div><%= f.label :password, "New password" %> | ||
<%= f.password_field :password, :autofocus => true %></div> | ||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= f.hidden_field :reset_password_token %> | ||
|
||
<div><%= f.label :password_confirmation, "Confirm new password" %> | ||
<%= f.password_field :password_confirmation %></div> | ||
<div><%= f.label :password, "New password" %> | ||
<%= f.password_field :password, :autofocus => true %></div> | ||
|
||
<div><%= f.submit "Change my password", class: "btn btn-primary" %></div> | ||
<% end %> | ||
<div><%= f.label :password_confirmation, "Confirm new password" %> | ||
<%= f.password_field :password_confirmation %></div> | ||
|
||
<div><%= f.submit "Change my password", class: "btn btn-primary" %></div> | ||
<% end %> | ||
|
||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
<div id="password"> | ||
<div class="container content_box clearfix"> | ||
<h3>Forgot your password?</h3> | ||
<div id="devise-mini"> | ||
<div class="container"> | ||
<div class="well"> | ||
|
||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> | ||
<%= devise_error_messages! %> | ||
<h3>Forgot your password?</h3> | ||
|
||
<div><%= f.label :email, "Please enter your email:" %> | ||
<%= f.email_field :email, :autofocus => true %></div> | ||
<p>Please enter your email below.</p> | ||
|
||
<div><%= f.submit "Send me reset password instructions", class: "btn btn-primary" %></div> | ||
<% end %> | ||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> | ||
<%= devise_error_messages! %> | ||
|
||
<div><%= f.label :email %> | ||
<%= f.email_field :email, :autofocus => true %></div> | ||
|
||
<div><%= f.submit "Send password reset email", class: "btn btn-primary" %></div> | ||
<% end %> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
# 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 = ENV['DEVISE_SECRET_KEY'] | ||
|
||
# ==> 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. | ||
config.mailer_sender = "[email protected]" | ||
# note that it will be overwritten if you use your own mailer class | ||
# with default "from" parameter. | ||
config.mailer_sender = '[email protected]' | ||
|
||
# Configure the class responsible to send e-mails. | ||
# config.mailer = "Devise::Mailer" | ||
# config.mailer = 'Devise::Mailer' | ||
|
||
# ==> ORM configuration | ||
# Load and configure the ORM. Supports :active_record (default) and | ||
|
@@ -61,8 +67,8 @@ | |
# If http headers should be returned for AJAX requests. True by default. | ||
# config.http_authenticatable_on_xhr = true | ||
|
||
# The realm used in Http Basic Authentication. "Application" by default. | ||
# config.http_authentication_realm = "Application" | ||
# The realm used in Http Basic Authentication. 'Application' by default. | ||
# config.http_authentication_realm = 'Application' | ||
|
||
# It will change confirmation, password recovery and other workflows | ||
# to behave the same regardless if the e-mail provided was right or wrong. | ||
|
@@ -92,7 +98,7 @@ | |
config.stretches = Rails.env.test? ? 1 : 10 | ||
|
||
# Setup a pepper to generate the encrypted password. | ||
# config.pepper = "bce28301f3fd7e1b6c3ddce3b95d432efa469df1e87d5ba56f8e2826e35bcdb58db429f355a6a7fe960503a2ca17b8ac70259c0b475db5e5dc6ef1317b407ebf" | ||
# config.pepper = '0a405e37fcba59f73262e8812e48c8e854cf991d0a9ce1e6822e3db088202d6ccf7ce325e620df73cbe4eddd381f43afa2ed39a78c60299775c161d4bc5b5f57' | ||
|
||
# ==> Configuration for :confirmable | ||
# A period that the user is allowed to access the website even without | ||
|
@@ -217,7 +223,7 @@ | |
# should add them to the navigational formats lists. | ||
# | ||
# The "*/*" below is required to match Internet Explorer requests. | ||
# config.navigational_formats = ["*/*", :html] | ||
# config.navigational_formats = ['*/*', :html] | ||
|
||
# The default HTTP method used to sign out a resource. Default is :delete. | ||
config.sign_out_via = :delete | ||
|
@@ -241,12 +247,12 @@ | |
# is mountable, there are some extra configurations to be taken into account. | ||
# The following options are available, assuming the engine is mounted as: | ||
# | ||
# mount MyEngine, at: "/my_engine" | ||
# mount MyEngine, at: '/my_engine' | ||
# | ||
# The router that invoked `devise_for`, in the example above, would be: | ||
# config.router_name = :my_engine | ||
# | ||
# When using omniauth, Devise cannot automatically set Omniauth path, | ||
# so you need to do it manually. For the users scope, it would be: | ||
# config.omniauth_path_prefix = "/my_engine/users/auth" | ||
# config.omniauth_path_prefix = '/my_engine/users/auth' | ||
end |
Oops, something went wrong.