lynndylanhurley / lynndylanhurley/devise_token_auth
User Concern is removing Devise settings
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 3.6k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
When I include
include DeviseTokenAuth::Concerns::User
below my devise settings
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :omniauth_providers => [:facebook, :google_oauth2]
include DeviseTokenAuth::Concerns::User
I am getting the following error
Mapping omniauth_callbacks on a resource that is not omniauthable (ArgumentError) Please add devise :omniauthable to the User model
I looked at the source code for
https://github.com/lynndylanhurley/devise_token_auth/blob/master/app/models/devise_token_auth/concerns/user.rb
I think the problem might be with
Hack to check if devise is already enabled
unless self.method_defined?(:devise_modules)
devise :database_authenticatable, :registerable,
:recoverable, :trackable, :validatable, :confirmable
else
self.devise_modules.delete(:omniauthable)
end
I am using
Rails 4.2
devise (3.5.1)
devise_token_auth (0.1.31)
omniauth (1.2.2)
omniauth-facebook (2.0.1)
omniauth-google-oauth2 (0.2.6)
omniauth-oauth2 (1.3.1)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app/models/devise_token_auth/concerns/user.rb, especially the devise_modules handling shown in the issue, and reproduce the error using the listed Rails, Devise, and devise_token_auth versions. Trace why an existing :omniauthable setting is removed, then verify that the User model retains the configured OmniAuth support without breaking the other Devise modules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100