Sha256: 8bea2cbb849331a8aef3fbcb972ad2139d6f077dedde5e9170a3f52361d1433d

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 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'

  # 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
  end

  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

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openstax_accounts-4.0.0 config/routes.rb
openstax_accounts-3.1.1 config/routes.rb