Sha256: 20b5229fd8fcd5098d391096e48e4127f754caafff34d98c2a05a74540b81d12

Contents?: true

Size: 1.11 KB

Versions: 37

Compression:

Stored size: 1.11 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 'callback', :path => 'auth/:provider/callback' # Authentication success
    get 'failure', :path => 'auth/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

37 entries across 37 versions & 1 rubygems

Version Path
openstax_accounts-7.13.1 config/routes.rb
openstax_accounts-7.13.0 config/routes.rb
openstax_accounts-7.12.0 config/routes.rb
openstax_accounts-7.11.0 config/routes.rb
openstax_accounts-7.10.0 config/routes.rb
openstax_accounts-7.9.0 config/routes.rb
openstax_accounts-7.8.0 config/routes.rb
openstax_accounts-7.7.0 config/routes.rb
openstax_accounts-7.6.0 config/routes.rb
openstax_accounts-7.5.0 config/routes.rb
openstax_accounts-7.4.0 config/routes.rb
openstax_accounts-7.3.0 config/routes.rb
openstax_accounts-7.2.0 config/routes.rb
openstax_accounts-7.1.0 config/routes.rb
openstax_accounts-7.0.1 config/routes.rb
openstax_accounts-7.0.0 config/routes.rb
openstax_accounts-6.4.2 config/routes.rb
openstax_accounts-6.4.1 config/routes.rb
openstax_accounts-6.4.0 config/routes.rb
openstax_accounts-6.3.2 config/routes.rb