Sha256: d59e8650660d7f6e96c2912b32622055d9ec7b3edec7d7169006b35cc6a3ecd4

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

OpenStax::Accounts::Engine.routes.draw do

  # Redirect here if we don't know what to do (theoretically should not happen)
  root to: 'sessions#new'

  # Shortcut to OmniAuth route that redirects to the Accounts server
  # This is provided by OmniAuth and is not in the SessionsController
  get '/auth/openstax', as: 'openstax_login'

  # User profile route
  if OpenStax::Accounts.configuration.enable_stubbing?
    namespace :dev do
      resources :accounts, only: [:index, :create] do
        post 'become', on: :member
        get 'search', on: :collection
      end
    end
  end

  # OmniAuth local routes (SessionsController)
  scope module: 'sessions' do
    get 'auth/:provider/callback', action: :callback, as: :callback # Authentication success
    get 'auth/failure', action: :failure, as: :failure              # Authentication failure

    get 'login', action: :new # Redirects to /auth/openstax or stub
    match 'logout', action: :destroy, # Redirects to logout path or stub
                    via: OpenStax::Accounts.configuration.logout_via
    get 'profile', action: :profile # Redirects to profile path or stub
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
openstax_accounts-8.1.1 config/routes.rb
openstax_accounts-8.1.0 config/routes.rb
openstax_accounts-8.0.1 config/routes.rb
openstax_accounts-8.0.0 config/routes.rb