Sha256: 849644612e6869d695335bad65cc064ae511a118ce6634603210c8309ff6356c

Contents?: true

Size: 1.6 KB

Versions: 18

Compression:

Stored size: 1.6 KB

Contents

Rails.application.routes.draw do
  # when using multiple models, controllers will default to the first available
  # devise mapping. routes for subsequent devise mappings will need to defined
  # within a `devise_scope` block

  # define :users as the first devise mapping:
  mount_devise_token_auth_for 'User', at: 'auth'

  # define :mangs as the second devise mapping. routes using this class will
  # need to be defined within a devise_scope as shown below
  mount_devise_token_auth_for "Mang", at: 'mangs'

  mount_devise_token_auth_for 'EvilUser', at: 'evil_user_auth', controllers: {
    confirmations:      'overrides/confirmations',
    passwords:          'overrides/passwords',
    omniauth_callbacks: 'overrides/omniauth_callbacks',
    registrations:      'overrides/registrations',
    sessions:           'overrides/sessions',
    token_validations:  'overrides/token_validations'
  }

  mount_devise_token_auth_for 'OnlyEmailUser', at: 'only_email_auth', skip: [:omniauth_callbacks]

  mount_devise_token_auth_for 'UnregisterableUser', at: 'unregisterable_user_auth', skip: [:registrations]

  # test namespacing
  namespace :api do
    scope :v1 do
      mount_devise_token_auth_for 'User', at: 'auth'
    end
  end

  # this route will authorize visitors using the User class
  get 'demo/members_only', to: 'demo_user#members_only'

  # routes within this block will authorize visitors using the Mang class
  get 'demo/members_only_mang', to: 'demo_mang#members_only'

  # routes within this block will authorize visitors using the Mang or User class
  get 'demo/members_only_group', to: 'demo_group#members_only'
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
devise_token_auth-0.1.32.beta9 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta8 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta7 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta6 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta5 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta4 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta3 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta2 test/dummy/config/routes.rb
devise_token_auth-0.1.32.beta1 test/dummy/config/routes.rb
devise_token_auth-0.1.31 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta10 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta9 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta8 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta7 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta6 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta5 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta4 test/dummy/config/routes.rb
devise_token_auth-0.1.31.beta3 test/dummy/config/routes.rb