Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devise and devise_token_auth omniauth callbacks #184

Closed
springerigor opened this issue Mar 13, 2015 · 5 comments
Closed

Devise and devise_token_auth omniauth callbacks #184

springerigor opened this issue Mar 13, 2015 · 5 comments

Comments

@springerigor
Copy link

I'm using devise_token_auth version 0.1.30 with Devise 3.4.0

routes.rb looks like:

devise_for :users, controllers: { omniauth_callbacks: "omniauth_sessions", sessions: "sessions", registrations: "registrations", passwords: "passwords"}

namespace :api, defaults: { format: :json } do
    mount_devise_token_auth_for 'User', at: 'auth', controllers: { omniauth_callbacks: "omniauth_token_callbacks" }
...

Sign up and sign in paths for devise_token_auth works fine. But /api/auth/:provider/ returns

undefined method `valid_encoding?' for :json:Symbol

When I moved mount_devise_token_auth_for outside api namespace an error occured:
ArgumentError: Invalid route name, already in use: 'new_user_session' as both Devise and devise_token_auth_for generate the same route new_user_session.

My main goal is to have different omniauth callbacks for Devise and token authentication (mobile app). I have two different controllers but I am unable to provide two different routes for them.

@lynndylanhurley
Copy link
Owner

It is possible to use this gem alongside standard Devise.

What are the steps to reproduce the undefined method error?

@springerigor
Copy link
Author

It occurs when I am trying to access /api/:provider/

@springerigor
Copy link
Author

@lynndylanhurley Any insight on this issue?

@ACPK
Copy link

ACPK commented May 28, 2015

@springerigor Did you find a solution?

@springerigor
Copy link
Author

Nope, it's obsolete so I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants