Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Bad redirect #18

Open
erjuampe opened this issue Dec 4, 2014 · 2 comments
Open

Bad redirect #18

erjuampe opened this issue Dec 4, 2014 · 2 comments

Comments

@erjuampe
Copy link

erjuampe commented Dec 4, 2014

Hello, thank you for this code. It has been very usefull.
I've tried it and it works fine. Only one issue. When I loging, the system redirect me to: 'myweb/redmine/cas'. In this url it's nothing. I change manually the url and I'am correctly login but it should redirect to: 'myweb/redmine'. How can I solve that? Can I change the url redirect in any file?

P.S.: sorry for my bad English.

@dgeo
Copy link

dgeo commented Jan 19, 2015

same here (and #20 it seems).
Here some projects are public (so I click on the login page), then:

  1. I'm 302-redirected to CAS, I login there
  2. then 302 to https://redmine_url/cas?ticket=...
  3. then 302 to https://redmine_url/cas idefinitely...
    Session is therefore established and manually going to https://redmine_url/ shows me logged in.

After trying to understand the code, I found that going to https://redmine_url/cas?ref=/ intead of clicking "Login with CAS" (that sends me to https://redmine_url/cas)

Cas server is jasig's 4.0...

Another tip: when logging out from CAS server, production.log shows:

ActionController::RoutingError (No route matches [POST] "/cas"):
  actionpack (3.2.19) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.19) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.19) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.19) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.19) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
  rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
  rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.19) lib/rails/engine.rb:484:in `call'
  railties (3.2.19) lib/rails/application.rb:231:in `call'
  railties (3.2.19) lib/rails/railtie/configurable.rb:30:in `method_missing'
  unicorn (4.6.3) lib/unicorn/http_server.rb:552:in `process_client'
  unicorn (4.6.3) lib/unicorn/http_server.rb:632:in `worker_loop'
  unicorn (4.6.3) lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
  unicorn (4.6.3) lib/unicorn/http_server.rb:142:in `start'
  unicorn (4.6.3) bin/unicorn_rails:209:in `'
  /usr/local/bin/unicorn_rails:23:in `load'
  /usr/local/bin/unicorn_rails:23:in `'

hope this helps …

@sebcworks
Copy link

I will eventually do a pull request, but for now, a quick solution is:
Modify the file redmine/plugins/redmine_cas/lib/redmine_cas/account_controller_patch.rb
and change the line 58:
default_url = url_for(params.merge(:ticket => nil))
by
default_url = home_url

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

No branches or pull requests

3 participants