auth.rb 1.4 KB

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. Zammad::Application.routes.draw do
  3. api_path = Rails.configuration.api_path
  4. # omniauth
  5. match '/auth/:provider/callback', to: 'sessions#create_omniauth', via: %i[post get puts delete]
  6. match '/auth/failure', to: 'sessions#failure_omniauth', via: %i[post get]
  7. # sso
  8. match '/auth/sso', to: 'sessions#create_sso', via: %i[get post]
  9. # two factor
  10. match api_path + '/auth/two_factor_initiate_authentication/:method', to: 'sessions#two_factor_authentication_method_initiate_authentication', via: :post
  11. # sessions
  12. match api_path + '/signin', to: 'sessions#create', via: :post
  13. match api_path + '/signshow', to: 'sessions#show', via: %i[get post]
  14. match api_path + '/signout', to: 'sessions#destroy', via: %i[get delete]
  15. match api_path + '/available', to: 'sessions#available', via: :get
  16. match api_path + '/sessions/switch/:id', to: 'sessions#switch_to_user', via: :get
  17. match api_path + '/sessions/switch_back', to: 'sessions#switch_back_to_user', via: :get
  18. match api_path + '/sessions', to: 'sessions#list', via: :get
  19. match api_path + '/sessions/:id', to: 'sessions#delete', via: :delete
  20. end