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

No route matches [GET] "/omniauth/sign_in" #199

Closed
andreydeineko opened this issue Mar 30, 2015 · 12 comments
Closed

No route matches [GET] "/omniauth/sign_in" #199

andreydeineko opened this issue Mar 30, 2015 · 12 comments

Comments

@andreydeineko
Copy link

In routes.rb I have following:

namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/'  do
    scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
      mount_devise_token_auth_for 'Tester', at: 'auth'
     # resources
    end
  end

It produces such route:

new_api_tester_session_path GET /auth/sign_in(.:format) devise_token_auth/sessions#new {:format=>:json, :subdomain=>"api"}

But when visiting the route, it changes path to

http://localhost:3000/omniauth/sign_in?resource_class=Tester

saying No route matches [GET] "/omniauth/sign_in".

When I simplify routes to

  namespace :api do
    scope :v1 do
      mount_devise_token_auth_for 'Tester', at: 'auth'
    end
  end

it produces

new_api_tester_session GET    /api/v1/auth/sign_in(.:format)                                 devise_token_auth/sessions#new

but throws:
Unknown action The action 'new' could not be found for DeviseTokenAuth::SessionsController

Some additional info:
Gem versions:
devise_token_auth (0.1.31), devise (~> 3.3)
Also I try to use ng-token-auth.

Any chance to get it working? Huge thanks for advice

@baramik
Copy link

baramik commented Mar 30, 2015

Hi, Andrey. Try to mount devise token auth outside api namespace like this

  mount_devise_token_auth_for 'User', at: '/auth'
  namespace :api, defaults: { format: :json } do
    scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do      
      resources :users do 
      end
    end
  end

@andreydeineko
Copy link
Author

Hi @baramik, when I do that I again get
Unknown action The action 'new' could not be found for DeviseTokenAuth::SessionsController

Do you may be know how to overcome this issue? Did you manage to resolve it? because I see your similar issue is closed by now

@andreydeineko
Copy link
Author

@lynndylanhurley hey, how would i deal with Unknown action The action 'new' could not be found for DeviseTokenAuth::SessionsController? Please, advise..

@nicolas-besnard
Copy link
Contributor

Why do you want to deal with it, as you don't need it ?

@andreydeineko
Copy link
Author

The only thing I want is to be able to reach /auth/sign_in point without having this error :)

@nicolas-besnard
Copy link
Contributor

Why do you want to reach /auth/sign_in with a GET request ?

On Wed, Apr 1, 2015 at 1:10 PM Andrey Deineko notifications@github.com
wrote:

The only thing I want is to be able to reach /auth/sign_in point without
having this error :)


Reply to this email directly or view it on GitHub
#199 (comment)
.

@andreydeineko
Copy link
Author

How would I change the request type? I was following this tutirial on establishing authentication and apparently author doesn't say anything regarding request method.

@nicolas-besnard
Copy link
Contributor

What do you want to do ? Register a new user ? Login an existing user ? Can you show me some code ?

@andreydeineko
Copy link
Author

My code is pretty much what is shown in the tutorial I linked in previous comment..

@boyfunky
Copy link

i am getting this error too when i try to sign up. I get the error the action 'new' could not be found for DeviseTokenAuth::RegistrationsController. How do i solve this problem? I cant seem to find any solution online

@nicolas-besnard
Copy link
Contributor

You don't need to access this route.

On Sun, Apr 12, 2015 at 4:29 AM Kingsley Simon notifications@github.com
wrote:

i am getting this error too when i try to sign up. I get the error the
action 'new' could not be found for
DeviseTokenAuth::RegistrationsController. How do i solve this problem? I
cant seem to find any solution online


Reply to this email directly or view it on GitHub
#199 (comment)
.

@zachfeldman
Copy link
Contributor

Hi there @andreydeineko ,

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

5 participants