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

Can't logout #109

Open
nerionavea opened this issue Jun 27, 2016 · 0 comments
Open

Can't logout #109

nerionavea opened this issue Jun 27, 2016 · 0 comments

Comments

@nerionavea
Copy link

Hi, i'm running an Rails 4 application and when i try to logout() in my frontend rails returns me next error:

App 4165 stdout: Started DELETE "/users/sign_out.json" for 186.92.249.37 at 2016-06-26 19:58:08 -0400
App 4165 stdout:
App 4165 stdout: ActionController::RoutingError (uninitialized constant UsersController):
App 4165 stdout: activesupport (4.0.13) lib/active_support/inflector/methods.rb:226:in const_get' App 4165 stdout: activesupport (4.0.13) lib/active_support/inflector/methods.rb:226:inblock in constantize'
App 4165 stdout: activesupport (4.0.13) lib/active_support/inflector/methods.rb:224:in each' App 4165 stdout: activesupport (4.0.13) lib/active_support/inflector/methods.rb:224:ininject'
App 4165 stdout: activesupport (4.0.13) lib/active_support/inflector/methods.rb:224:in constantize' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/routing/route_set.rb:78:incontroller_reference'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/routing/route_set.rb:68:in controller' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/routing/route_set.rb:46:incall'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/journey/router.rb:71:in block in call' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/journey/router.rb:59:ineach'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/journey/router.rb:59:in call' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/routing/route_set.rb:676:incall'
App 4165 stdout: warden (1.2.6) lib/warden/manager.rb:35:in block in call' App 4165 stdout: warden (1.2.6) lib/warden/manager.rb:34:incatch'
App 4165 stdout: warden (1.2.6) lib/warden/manager.rb:34:in call' App 4165 stdout: rack (1.5.5) lib/rack/etag.rb:23:incall'
App 4165 stdout: rack (1.5.5) lib/rack/conditionalget.rb:35:in call' App 4165 stdout: rack (1.5.5) lib/rack/head.rb:11:incall'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/params_parser.rb:27:in call' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/flash.rb:241:incall'
App 4165 stdout: rack (1.5.5) lib/rack/session/abstract/id.rb:225:in context' App 4165 stdout: rack (1.5.5) lib/rack/session/abstract/id.rb:220:incall'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/cookies.rb:486:in call' App 4165 stdout: activerecord (4.0.13) lib/active_record/query_cache.rb:36:incall'
App 4165 stdout: activerecord (4.0.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in call' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call'
App 4165 stdout: activesupport (4.0.13) lib/active_support/callbacks.rb:373:in _run__1728321203542731943__call__callbacks' App 4165 stdout: activesupport (4.0.13) lib/active_support/callbacks.rb:80:inrun_callbacks'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/callbacks.rb:27:in call' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/remote_ip.rb:76:incall'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call' App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/show_exceptions.rb:30:incall'
App 4165 stdout: railties (4.0.13) lib/rails/rack/logger.rb:38:in call_app' App 4165 stdout: railties (4.0.13) lib/rails/rack/logger.rb:20:inblock in call'
App 4165 stdout: activesupport (4.0.13) lib/active_support/tagged_logging.rb:68:in block in tagged' App 4165 stdout: activesupport (4.0.13) lib/active_support/tagged_logging.rb:26:intagged'
App 4165 stdout: activesupport (4.0.13) lib/active_support/tagged_logging.rb:68:in tagged' App 4165 stdout: railties (4.0.13) lib/rails/rack/logger.rb:20:incall'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/request_id.rb:21:in call' App 4165 stdout: rack (1.5.5) lib/rack/methodoverride.rb:21:incall'
App 4165 stdout: rack (1.5.5) lib/rack/runtime.rb:17:in call' App 4165 stdout: activesupport (4.0.13) lib/active_support/cache/strategy/local_cache.rb:83:incall'
App 4165 stdout: actionpack (4.0.13) lib/action_dispatch/middleware/static.rb:84:in call' App 4165 stdout: rack (1.5.5) lib/rack/sendfile.rb:112:incall'
App 4165 stdout: rack-cors (0.4.0) lib/rack/cors.rb:80:in call' App 4165 stdout: rack-cors (0.4.0) lib/rack/cors.rb:80:incall'
App 4165 stdout: railties (4.0.13) lib/rails/engine.rb:511:in call' App 4165 stdout: railties (4.0.13) lib/rails/application.rb:97:incall'
App 4165 stdout: rack-cors (0.4.0) lib/rack/cors.rb:80:in call' App 4165 stdout: passenger (5.0.28) src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:97:inprocess_request'
App 4165 stdout: passenger (5.0.28) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:160:in accept_and_process_next_request' App 4165 stdout: passenger (5.0.28) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:113:inmain_loop'
App 4165 stdout: passenger (5.0.28) src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in block (3 levels) in start_threads' App 4165 stdout: passenger (5.0.28) src/ruby_supportlib/phusion_passenger/utils.rb:113:inblock in create_thread_and_abort_on_exception'
App 4165 stdout:
App 4165 stdout:

I tried to change the route in route.rb writing somenthing like this:

First I tried to make this logout on a GET request instead of DELETE request

devise_for :users do get 'users/sign_out' => "devise/sessions#destroy" end

and I changed the config in angular with this

AuthProvider.logoutMethod('GET');

but stills returns me the same error

then I tried to create again the same route that supoossed that devise creates:

devise_for :users do delete 'users/sign_out' => "devise/sessions#destroy" end

and then I deleted the angular AuthProvider.logoutMethod('GET');

and still on same error, I don't know if I must setup something on rails for this or something is wrong with my aproach

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

1 participant