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 redirecting Web request to the Token JSON API #821

Closed
JohnMerlino2 opened this issue Jan 27, 2017 · 3 comments
Closed

Devise redirecting Web request to the Token JSON API #821

JohnMerlino2 opened this issue Jan 27, 2017 · 3 comments

Comments

@JohnMerlino2
Copy link

I am using devise, both for web and mobile. The web authentication was working fine until I added the devise_token_auth gem. Once I added that gem, I changed the routes file to add a namespace:

  devise_for :users, controllers: { omniauth_callbacks: "omniauth_callbacks" }
  namespace :api do
    scope :v1 do
      mount_devise_token_auth_for "User", at: 'auth'
    end
  end

Now when I visit localhost:3000 on the web google chrome browser, I get a json text on the page:

{"errors":["Authorized users only."]}

Since I accessed the page on the web, I should not be getting json response, I should see the web page. What am I doing wrong?

@murat
Copy link

murat commented Mar 17, 2017

+1 this issue

@roshangm1
Copy link

same issue here.

@zachfeldman
Copy link
Contributor

Hi there @JohnMerlino2 ,

In an effort to cleanup this project and prioritize a bit, we're marking issues that haven't had any activity in a while with a "close-in-7-days" label. If we don't hear from you in about a week, we'll be closing this issue. Obviously feel free to re-open it at any time if it's the right time or this was done in error!

If you are still having the issue (especially if it's a bug report) please refer to our new Issue Template to provide some more details to help us solve it.

Hope all is well.

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

No branches or pull requests

4 participants