xing_backend_token_auth 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +13 -0
  3. data/README.md +679 -0
  4. data/Rakefile +34 -0
  5. data/app/controllers/devise_token_auth/application_controller.rb +22 -0
  6. data/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +110 -0
  7. data/app/controllers/devise_token_auth/confirmations_controller.rb +31 -0
  8. data/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +169 -0
  9. data/app/controllers/devise_token_auth/passwords_controller.rb +107 -0
  10. data/app/controllers/devise_token_auth/registrations_controller.rb +99 -0
  11. data/app/controllers/devise_token_auth/sessions_controller.rb +50 -0
  12. data/app/controllers/devise_token_auth/token_validations_controller.rb +22 -0
  13. data/app/serializers/devise_token_auth/error_messages_serializer.rb +16 -0
  14. data/app/serializers/devise_token_auth/resource_errors_serializer.rb +24 -0
  15. data/app/serializers/devise_token_auth/resource_serializer.rb +17 -0
  16. data/app/serializers/devise_token_auth/success_message_serializer.rb +15 -0
  17. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  18. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  19. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  20. data/app/views/devise_token_auth/omniauth_failure.html.erb +2 -0
  21. data/app/views/devise_token_auth/omniauth_success.html.erb +8 -0
  22. data/app/views/layouts/omniauth_response.html.erb +31 -0
  23. data/config/initializers/devise.rb +207 -0
  24. data/config/initializers/token_auth_failure_app.rb +7 -0
  25. data/config/locales/devise.en.yml +59 -0
  26. data/config/routes.rb +5 -0
  27. data/lib/devise_token_auth.rb +9 -0
  28. data/lib/devise_token_auth/controllers/helpers.rb +129 -0
  29. data/lib/devise_token_auth/controllers/url_helpers.rb +8 -0
  30. data/lib/devise_token_auth/engine.rb +32 -0
  31. data/lib/devise_token_auth/models/token_authenticatable.rb +195 -0
  32. data/lib/devise_token_auth/rails/routes.rb +65 -0
  33. data/lib/generators/devise_token_auth/USAGE +31 -0
  34. data/lib/generators/devise_token_auth/install_generator.rb +100 -0
  35. data/lib/generators/devise_token_auth/install_views_generator.rb +16 -0
  36. data/lib/generators/devise_token_auth/templates/devise_token_auth.rb +22 -0
  37. data/lib/generators/devise_token_auth/templates/devise_token_auth_add_token_info_to_users.rb.erb +14 -0
  38. data/lib/tasks/devise_token_auth_tasks.rake +4 -0
  39. data/lib/xing_backend_token_auth.rb +1 -0
  40. data/test/controllers/demo_group_controller_test.rb +126 -0
  41. data/test/controllers/demo_mang_controller_test.rb +263 -0
  42. data/test/controllers/demo_user_controller_test.rb +262 -0
  43. data/test/controllers/devise_token_auth/confirmations_controller_test.rb +107 -0
  44. data/test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb +144 -0
  45. data/test/controllers/devise_token_auth/passwords_controller_test.rb +275 -0
  46. data/test/controllers/devise_token_auth/registrations_controller_test.rb +405 -0
  47. data/test/controllers/devise_token_auth/registrations_controller_test.rb.orig +494 -0
  48. data/test/controllers/devise_token_auth/sessions_controller_test.rb +169 -0
  49. data/test/controllers/overrides/confirmations_controller_test.rb +44 -0
  50. data/test/controllers/overrides/omniauth_callbacks_controller_test.rb +44 -0
  51. data/test/controllers/overrides/passwords_controller_test.rb +64 -0
  52. data/test/controllers/overrides/registrations_controller_test.rb +42 -0
  53. data/test/controllers/overrides/sessions_controller_test.rb +35 -0
  54. data/test/controllers/overrides/token_validations_controller_test.rb +38 -0
  55. data/test/dummy/README.rdoc +28 -0
  56. data/test/dummy/Rakefile +6 -0
  57. data/test/dummy/app/assets/images/logo.jpg +0 -0
  58. data/test/dummy/app/assets/images/omniauth-provider-settings.png +0 -0
  59. data/test/dummy/app/assets/javascripts/application.js +13 -0
  60. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  61. data/test/dummy/app/controllers/application_controller.rb +16 -0
  62. data/test/dummy/app/controllers/demo_group_controller.rb +13 -0
  63. data/test/dummy/app/controllers/demo_mang_controller.rb +12 -0
  64. data/test/dummy/app/controllers/demo_user_controller.rb +12 -0
  65. data/test/dummy/app/controllers/overrides/confirmations_controller.rb +32 -0
  66. data/test/dummy/app/controllers/overrides/omniauth_callbacks_controller.rb +14 -0
  67. data/test/dummy/app/controllers/overrides/passwords_controller.rb +39 -0
  68. data/test/dummy/app/controllers/overrides/registrations_controller.rb +27 -0
  69. data/test/dummy/app/controllers/overrides/sessions_controller.rb +26 -0
  70. data/test/dummy/app/controllers/overrides/token_validations_controller.rb +23 -0
  71. data/test/dummy/app/controllers/registrations_controller.rb +2 -0
  72. data/test/dummy/app/helpers/application_helper.rb +1065 -0
  73. data/test/dummy/app/models/evil_user.rb +5 -0
  74. data/test/dummy/app/models/mang.rb +5 -0
  75. data/test/dummy/app/models/user.rb +20 -0
  76. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  77. data/test/dummy/bin/bundle +3 -0
  78. data/test/dummy/bin/rails +8 -0
  79. data/test/dummy/bin/rake +8 -0
  80. data/test/dummy/bin/spring +18 -0
  81. data/test/dummy/config.ru +16 -0
  82. data/test/dummy/config/application.rb +23 -0
  83. data/test/dummy/config/boot.rb +5 -0
  84. data/test/dummy/config/database.yml +31 -0
  85. data/test/dummy/config/environment.rb +5 -0
  86. data/test/dummy/config/environments/development.rb +44 -0
  87. data/test/dummy/config/environments/production.rb +82 -0
  88. data/test/dummy/config/environments/test.rb +40 -0
  89. data/test/dummy/config/initializers/assets.rb +8 -0
  90. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  91. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  92. data/test/dummy/config/initializers/devise_token_auth.rb +22 -0
  93. data/test/dummy/config/initializers/figaro.rb +1 -0
  94. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  95. data/test/dummy/config/initializers/inflections.rb +16 -0
  96. data/test/dummy/config/initializers/mime_types.rb +4 -0
  97. data/test/dummy/config/initializers/omniauth.rb +8 -0
  98. data/test/dummy/config/initializers/session_store.rb +3 -0
  99. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  100. data/test/dummy/config/locales/en.yml +23 -0
  101. data/test/dummy/config/routes.rb +32 -0
  102. data/test/dummy/config/secrets.yml +22 -0
  103. data/test/dummy/config/spring.rb +1 -0
  104. data/test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb +56 -0
  105. data/test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb +56 -0
  106. data/test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb +6 -0
  107. data/test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb +5 -0
  108. data/test/dummy/db/migrate/20140928231203_devise_token_auth_create_evil_users.rb +57 -0
  109. data/test/dummy/db/schema.rb +111 -0
  110. data/test/dummy/public/404.html +67 -0
  111. data/test/dummy/public/422.html +67 -0
  112. data/test/dummy/public/500.html +66 -0
  113. data/test/dummy/public/favicon.ico +0 -0
  114. data/test/fixtures/evil_users.yml +29 -0
  115. data/test/fixtures/mangs.yml +29 -0
  116. data/test/fixtures/users.yml +29 -0
  117. data/test/integration/navigation_test.rb +10 -0
  118. data/test/lib/generators/devise_token_auth/install_generator_test.rb +131 -0
  119. data/test/lib/generators/devise_token_auth/install_views_generator_test.rb +23 -0
  120. data/test/models/user_test.rb +81 -0
  121. data/test/test_helper.rb +60 -0
  122. metadata +320 -0
@@ -0,0 +1,5 @@
1
+ class EvilUser < ActiveRecord::Base
2
+ devise :database_authenticatable, :registerable,
3
+ :recoverable, :rememberable, :trackable, :validatable,
4
+ :confirmable, :omniauthable, :token_authenticatable
5
+ end
@@ -0,0 +1,5 @@
1
+ class Mang < ActiveRecord::Base
2
+ devise :database_authenticatable, :registerable,
3
+ :recoverable, :rememberable, :trackable, :validatable,
4
+ :confirmable, :omniauthable, :token_authenticatable
5
+ end
@@ -0,0 +1,20 @@
1
+ class User < ActiveRecord::Base
2
+ devise :database_authenticatable, :registerable,
3
+ :recoverable, :rememberable, :trackable, :validatable,
4
+ :confirmable, :omniauthable, :token_authenticatable
5
+
6
+ validates :operating_thetan, numericality: true, allow_nil: true
7
+ validate :ensure_correct_favorite_color
8
+
9
+ def ensure_correct_favorite_color
10
+
11
+ if favorite_color and favorite_color != ""
12
+ unless ApplicationHelper::COLOR_NAMES.any?{ |s| s.casecmp(favorite_color)==0 }
13
+ matches = ApplicationHelper::COLOR_SEARCH.search(favorite_color)
14
+ closest_match = matches.last[:string]
15
+ second_closest_match = matches[-2][:string]
16
+ errors.add(:favorite_color, "We've never heard of the color \"#{favorite_color}\". Did you mean \"#{closest_match}\"? Or perhaps \"#{second_closest_match}\"?")
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
7
+ require_relative '../config/boot'
8
+ require 'rails/commands'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require_relative '../config/boot'
7
+ require 'rake'
8
+ Rake.application.run
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast
4
+ # It gets overwritten when you run the `spring binstub` command
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12
+ ENV["GEM_HOME"] = ""
13
+ Gem.paths = ENV
14
+
15
+ gem "spring", match[1]
16
+ require "spring/binstub"
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
5
+
6
+ # allow cross origin requests
7
+ require 'rack/cors'
8
+ use Rack::Cors do
9
+ allow do
10
+ origins '*'
11
+ resource '*',
12
+ :headers => :any,
13
+ :expose => ['access-token', 'expiry', 'token-type', 'uid', 'client'],
14
+ :methods => [:get, :post, :options, :delete, :put]
15
+ end
16
+ end
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rack/cors'
4
+ require 'rails/all'
5
+
6
+ Bundler.require(*Rails.groups)
7
+ require "devise_token_auth"
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,31 @@
1
+ sqlite: &sqlite
2
+ adapter: sqlite3
3
+ database: db/<%= Rails.env %>.sqlite3
4
+
5
+ mysql: &mysql
6
+ adapter: mysql2
7
+ username: root
8
+ password:
9
+ database: "devise_token_auth_<%= Rails.env %>"
10
+
11
+ postgresql: &postgresql
12
+ adapter: postgresql
13
+ username: postgres
14
+ password:
15
+ database: "devise_token_auth_<%= Rails.env %>"
16
+ min_messages: ERROR
17
+
18
+ defaults: &defaults
19
+ pool: 5
20
+ timeout: 5000
21
+ host: localhost
22
+ <<: *<%= ENV['DB'] || "sqlite" %>
23
+
24
+ development:
25
+ <<: *defaults
26
+
27
+ test:
28
+ <<: *defaults
29
+
30
+ production:
31
+ <<: *defaults
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,44 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = true
18
+
19
+ # use mailcatcher for development
20
+ config.action_mailer.default_url_options = { :host => 'devise-token-auth.dev' }
21
+ config.action_mailer.delivery_method = :smtp
22
+ config.action_mailer.smtp_settings = { :address => 'localhost', :port => 1025 }
23
+
24
+ # Print deprecation notices to the Rails logger.
25
+ config.active_support.deprecation = :log
26
+
27
+ # Raise an error on page load if there are pending migrations.
28
+ config.active_record.migration_error = :page_load
29
+
30
+ # Debug mode disables concatenation and preprocessing of assets.
31
+ # This option may cause significant delays in view rendering with a large
32
+ # number of complex assets.
33
+ config.assets.debug = true
34
+
35
+ # Adds additional error checking when serving assets at runtime.
36
+ # Checks for improperly declared sprockets dependencies.
37
+ # Raises helpful error messages.
38
+ config.assets.raise_runtime_errors = true
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+
43
+ OmniAuth.config.full_host = "http://devise-token-auth.dev"
44
+ end
@@ -0,0 +1,82 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Generate digests for assets URLs.
33
+ config.assets.digest = true
34
+
35
+ # `config.assets.precompile` has moved to config/initializers/assets.rb
36
+
37
+ # Specifies the header that your server uses for sending files.
38
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
39
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
40
+
41
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
42
+ # config.force_ssl = true
43
+
44
+ # Set to :debug to see everything in the log.
45
+ config.log_level = :info
46
+
47
+ # Prepend all log lines with the following tags.
48
+ # config.log_tags = [ :subdomain, :uuid ]
49
+
50
+ # Use a different logger for distributed setups.
51
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
52
+
53
+ # Use a different cache store in production.
54
+ # config.cache_store = :mem_cache_store
55
+
56
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
57
+ # config.action_controller.asset_host = "http://assets.example.com"
58
+
59
+ # Precompile additional assets.
60
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
61
+ # config.assets.precompile += %w( search.js )
62
+
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65
+ # config.action_mailer.raise_delivery_errors = false
66
+
67
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # the I18n.default_locale when a translation cannot be found).
69
+ config.i18n.fallbacks = true
70
+
71
+ # Send deprecation notices to registered listeners.
72
+ config.active_support.deprecation = :notify
73
+
74
+ # Disable automatic flushing of the log to improve performance.
75
+ # config.autoflush_log = false
76
+
77
+ # Use default logging formatter so that PID and timestamp are not suppressed.
78
+ config.log_formatter = ::Logger::Formatter.new
79
+
80
+ # Do not dump schema after migrations.
81
+ config.active_record.dump_schema_after_migration = false
82
+ end
@@ -0,0 +1,40 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+ config.action_mailer.default_url_options = { :host => 'localhost' }
34
+
35
+ # Print deprecation notices to the stderr.
36
+ config.active_support.deprecation = :stderr
37
+
38
+ # Raises error for missing translations
39
+ # config.action_view.raise_on_missing_translations = true
40
+ end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Precompile additional assets.
7
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,22 @@
1
+ DeviseTokenAuth.setup do |config|
2
+ # By default the authorization headers will change after each request. The
3
+ # client is responsible for keeping track of the changing tokens. Change
4
+ # this to false to prevent the Authorization header from changing after
5
+ # each request.
6
+ #config.change_headers_on_each_request = true
7
+
8
+ # By default, users will need to re-authenticate after 2 weeks. This setting
9
+ # determines how long tokens will remain valid after they are issued.
10
+ #config.token_lifespan = 2.weeks
11
+
12
+ # Sometimes it's necessary to make several requests to the API at the same
13
+ # time. In this case, each request in the batch will need to share the same
14
+ # auth token. This setting determines how far apart the requests can be while
15
+ # still using the same auth token.
16
+ #config.batch_request_buffer_throttle = 5.seconds
17
+
18
+ # This route will be the prefix for all oauth2 redirect callbacks. For
19
+ # example, using the default '/omniauth', the github oauth2 provider will
20
+ # redirect successful authentications to '/omniauth/github/callback'
21
+ #config.omniauth_prefix = "/omniauth"
22
+ end
@@ -0,0 +1 @@
1
+ #Figaro.require("GITHUB_KEY", "GITHUB_SECRET", "FACEBOOK_KEY", "FACEBOOK_SECRET", "GOOGLE_KEY", "GOOGLE_SECRET")
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,8 @@
1
+ Rails.application.config.middleware.use OmniAuth::Builder do |b|
2
+ provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope: 'email,profile'
3
+ provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']
4
+ provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET']
5
+ provider :developer,
6
+ :fields => [:first_name, :last_name],
7
+ :uid_field => :last_name
8
+ end
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'