From b61aa2cba681918b9bb5d6486cbb59803d1cab99 Mon Sep 17 00:00:00 2001 From: aarongray Date: Tue, 25 Aug 2015 12:35:37 -0700 Subject: [PATCH] Add description to readme about the devise.rb initializer. Right now the readme doesn't contain any info about this file, although it is an important part of configuring this library, and our example app uses it. Adding this section here should make it a little easier on newcomers to learn that this part of configuring devise. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index a5a6e8aec..704a91e26 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,20 @@ The following settings are available for configuration in `config/initializers/d | **`default_password_reset_url`** | `nil` | By default this value is expected to be sent by the client so that the API knows where to redirect users after successful password resets. If this param is set, the API will redirect to this value when no value is provided by the cilent. | | **`redirect_whitelist`** | `nil` | As an added security measure, you can limit the URLs to which the API will redirect after email token validation (password reset, email confirmation, etc.). This value should be an array containing exact matches to the client URLs to be visited after validation. | +Additionally, you can configure other aspects of devise by manually creating the traditional devise.rb file at `config/initializers/devise.rb`. Here are some examples of what you can do in this file: + +~~~ruby +Devise.setup do |config| + # The e-mail address that mail will appear to be sent from + # If absent, mail is sent from "please-change-me-at-config-initializers-devise@example.com" + config.mailer_sender = "support@myapp.com" + + # If using rails-api, you may want to tell devise to not use ActionDispatch::Flash + # middleware b/c rails-api does not include it. + # See: http://stackoverflow.com/q/19600905/806956 + config.navigational_formats = [:json] +end +~~~ ## OmniAuth authentication