Use `scope module: ...` block for `.well-known` routes (#30959)

main
Matt Jankowski 2024-07-09 03:34:15 -04:00 committed by GitHub
parent 0dd4595704
commit 7a30c68953
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 6 deletions

View File

@ -63,12 +63,16 @@ Rails.application.routes.draw do
tokens: 'oauth/tokens' tokens: 'oauth/tokens'
end end
get '.well-known/oauth-authorization-server', to: 'well_known/oauth_metadata#show', as: :oauth_metadata, defaults: { format: 'json' } scope path: '.well-known' do
get '.well-known/host-meta', to: 'well_known/host_meta#show', as: :host_meta, defaults: { format: 'xml' } scope module: :well_known do
get '.well-known/nodeinfo', to: 'well_known/node_info#index', as: :nodeinfo, defaults: { format: 'json' } get 'oauth-authorization-server', to: 'oauth_metadata#show', as: :oauth_metadata, defaults: { format: 'json' }
get '.well-known/webfinger', to: 'well_known/webfinger#show', as: :webfinger get 'host-meta', to: 'host_meta#show', as: :host_meta, defaults: { format: 'xml' }
get '.well-known/change-password', to: redirect('/auth/edit') get 'nodeinfo', to: 'node_info#index', as: :nodeinfo, defaults: { format: 'json' }
get '.well-known/proxy', to: redirect { |_, request| "/authorize_interaction?#{request.params.to_query}" } get 'webfinger', to: 'webfinger#show', as: :webfinger
end
get 'change-password', to: redirect('/auth/edit'), as: nil
get 'proxy', to: redirect { |_, request| "/authorize_interaction?#{request.params.to_query}" }, as: nil
end
get '/nodeinfo/2.0', to: 'well_known/node_info#show', as: :nodeinfo_schema get '/nodeinfo/2.0', to: 'well_known/node_info#show', as: :nodeinfo_schema