2010-10-14 18:04:02 +00:00
|
|
|
require 'devise/omniauth'
|
|
|
|
|
|
|
|
module Devise
|
|
|
|
module Models
|
2010-10-14 21:46:10 +00:00
|
|
|
# Adds OmniAuth support to your model.
|
2010-10-14 18:04:02 +00:00
|
|
|
#
|
|
|
|
# == Options
|
|
|
|
#
|
|
|
|
# Oauthable adds the following options to devise_for:
|
|
|
|
#
|
2013-04-29 04:52:37 +00:00
|
|
|
# * +omniauth_providers+: Which providers are available to this model. It expects an array:
|
2010-10-14 18:04:02 +00:00
|
|
|
#
|
2014-02-25 16:42:55 +00:00
|
|
|
# devise_for :database_authenticatable, :omniauthable, omniauth_providers: [:twitter]
|
2010-10-14 18:04:02 +00:00
|
|
|
#
|
|
|
|
module Omniauthable
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2012-02-24 22:56:04 +00:00
|
|
|
def self.required_fields(klass)
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
|
2010-10-14 18:04:02 +00:00
|
|
|
module ClassMethods
|
|
|
|
Devise::Models.config(self, :omniauth_providers)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2013-04-29 04:52:37 +00:00
|
|
|
end
|