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

locale in url: service url fail #65

Open
kaligrafy opened this issue Mar 6, 2013 · 1 comment
Open

locale in url: service url fail #65

kaligrafy opened this issue Mar 6, 2013 · 1 comment

Comments

@kaligrafy
Copy link

I use the rails-translate-routes gem to localize routes. All my routes now use a prefix with the language in it. Exemple: localhost/en/rest_of_the_url

But with cas_authenticable, the service url fail since the locale is not prefixed.

How can I fix that? There doen't seem to be any config entry to change the service url.

Thanks!

@nbudin
Copy link
Owner

nbudin commented Apr 7, 2013

I think you can simply override the routes in your routes.rb by defining them above your devise_for call, therefore they will get a higher route priority than the ones we generate in the gem. For example, you could do:

get "/:locale/service", :to => "Devise::CasSessions#service", :as => "service"
post "/:locale/service", :to => "Devise::CasSessions#single_sign_out", :as => "single_sign_out"

devise_for :users

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

2 participants