1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Update casing of 'OmniAuth' to match that of official OmniAuth documentation

This commit is contained in:
Dave Powers 2014-11-14 14:45:09 -05:00
parent c47ab5e6cf
commit 63ae9701b4
7 changed files with 12 additions and 12 deletions

View file

@ -18,7 +18,7 @@ Devise is a flexible authentication solution for Rails based on Warden. It:
It's composed of 10 modules: It's composed of 10 modules:
* [Database Authenticatable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable): encrypts and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication. * [Database Authenticatable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable): encrypts and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication.
* [Omniauthable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Omniauthable): adds Omniauth (https://github.com/intridea/omniauth) support. * [Omniauthable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/intridea/omniauth) support.
* [Confirmable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in. * [Confirmable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in.
* [Recoverable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions. * [Recoverable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions.
* [Registerable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account. * [Registerable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account.
@ -439,15 +439,15 @@ There are two things that are important to keep in mind:
get :new get :new
``` ```
### Omniauth ### OmniAuth
Devise comes with Omniauth support out of the box to authenticate with other providers. To use it, just specify your omniauth configuration in `config/initializers/devise.rb`: Devise comes with OmniAuth support out of the box to authenticate with other providers. To use it, just specify your OmniAuth configuration in `config/initializers/devise.rb`:
```ruby ```ruby
config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
``` ```
You can read more about Omniauth support in the wiki: You can read more about OmniAuth support in the wiki:
* https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview * https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

View file

@ -246,7 +246,7 @@ module Devise
mattr_accessor :router_name mattr_accessor :router_name
@@router_name = nil @@router_name = nil
# Set the omniauth path prefix so it can be overridden when # Set the OmniAuth path prefix so it can be overridden when
# Devise is used in a mountable engine # Devise is used in a mountable engine
mattr_accessor :omniauth_path_prefix mattr_accessor :omniauth_path_prefix
@@omniauth_path_prefix = nil @@omniauth_path_prefix = nil
@ -261,7 +261,7 @@ module Devise
mattr_reader :mappings mattr_reader :mappings
@@mappings = ActiveSupport::OrderedHash.new @@mappings = ActiveSupport::OrderedHash.new
# Omniauth configurations. # OmniAuth configurations.
mattr_reader :omniauth_configs mattr_reader :omniauth_configs
@@omniauth_configs = ActiveSupport::OrderedHash.new @@omniauth_configs = ActiveSupport::OrderedHash.new
@ -417,7 +417,7 @@ module Devise
@@warden_config_blocks << block @@warden_config_blocks << block
end end
# Specify an omniauth provider. # Specify an OmniAuth provider.
# #
# config.omniauth :github, APP_ID, APP_SECRET # config.omniauth :github, APP_ID, APP_SECRET
# #

View file

@ -2,7 +2,7 @@ module Devise
module Controllers module Controllers
# A module that may be optionally included in a controller in order # A module that may be optionally included in a controller in order
# to provide remember me behavior. Useful when signing in is done # to provide remember me behavior. Useful when signing in is done
# through a callback, like in Omniauth. # through a callback, like in OmniAuth.
module Rememberable module Rememberable
# Return default cookie values retrieved from session options. # Return default cookie values retrieved from session options.
def self.cookie_values def self.cookie_values

View file

@ -402,7 +402,7 @@ module ActionDispatch::Routing
def devise_omniauth_callback(mapping, controllers) #:nodoc: def devise_omniauth_callback(mapping, controllers) #:nodoc:
if mapping.fullpath =~ /:[a-zA-Z_]/ if mapping.fullpath =~ /:[a-zA-Z_]/
raise <<-ERROR raise <<-ERROR
Devise does not support scoping omniauth callbacks under a dynamic segment Devise does not support scoping OmniAuth callbacks under a dynamic segment
and you have set #{mapping.fullpath.inspect}. You can work around by passing and you have set #{mapping.fullpath.inspect}. You can work around by passing
`skip: :omniauth_callbacks` and manually defining the routes. Here is an example: `skip: :omniauth_callbacks` and manually defining the routes. Here is an example:

View file

@ -21,7 +21,7 @@ class <%= @scope_prefix %>OmniauthCallbacksController < Devise::OmniauthCallback
# protected # protected
# The path used when omniauth fails # The path used when OmniAuth fails
# def after_omniauth_failure_path_for(scope) # def after_omniauth_failure_path_for(scope)
# super(scope) # super(scope)
# end # end

View file

@ -257,7 +257,7 @@ Devise.setup do |config|
# The router that invoked `devise_for`, in the example above, would be: # The router that invoked `devise_for`, in the example above, would be:
# config.router_name = :my_engine # config.router_name = :my_engine
# #
# When using omniauth, Devise cannot automatically set Omniauth path, # When using OmniAuth, Devise cannot automatically set OmniAuth path,
# so you need to do it manually. For the users scope, it would be: # 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 end

View file

@ -121,7 +121,7 @@ class OmniauthableIntegrationTest < ActionDispatch::IntegrationTest
assert_contain 'Could not authenticate you from Facebook because "Access denied".' assert_contain 'Could not authenticate you from Facebook because "Access denied".'
end end
test "handles other exceptions from omniauth" do test "handles other exceptions from OmniAuth" do
OmniAuth.config.mock_auth[:facebook] = :invalid_credentials OmniAuth.config.mock_auth[:facebook] = :invalid_credentials
visit "/users/sign_in" visit "/users/sign_in"