Created
July 14, 2016 16:13
-
-
Save rsl/672c8b599aff0dbadb9a9375fbe347b4 to your computer and use it in GitHub Desktop.
Routing fix for devise_saml_authenticatable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Snip snip snip | |
devise_for :users, skip: [:registrations, :saml_authenticatable], controllers: {sessions: 'devise_sessions'} | |
# Manually add user editing but disallow registrations [above] | |
as :user do | |
get 'users/edit' => 'devise_registrations#edit', as: 'edit_registration' | |
patch 'users' => 'devise_registrations#update', as: 'registration' | |
# To avoid conflict saml_authenticatable routes are manually defined here. | |
# Also we override the controller. | |
resource :session, as: 'saml_session', only: [], controller: 'devise_saml_sessions', path: '/companies/:id/saml' do | |
get :new, path: 'sign_in', as: 'new' | |
post :create, path: 'auth' | |
match :destroy, path: 'sign_out', as: 'destroy', via: :get | |
get :metadata, path: 'metadata' | |
match :idp_sign_out, path: 'idp_sign_out', via: [:get, :post] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment