sorcery 0.17.0 → 0.18.0

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 (154) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -1
  3. data/README.md +8 -5
  4. data/lib/generators/sorcery/helpers.rb +1 -1
  5. data/lib/generators/sorcery/install_generator.rb +9 -18
  6. data/lib/generators/sorcery/templates/initializer.rb +24 -10
  7. data/lib/sorcery/adapters/active_record_adapter.rb +12 -14
  8. data/lib/sorcery/adapters/mongoid_adapter.rb +6 -8
  9. data/lib/sorcery/controller/config.rb +27 -29
  10. data/lib/sorcery/controller/submodules/activity_logging.rb +4 -7
  11. data/lib/sorcery/controller/submodules/brute_force_protection.rb +4 -1
  12. data/lib/sorcery/controller/submodules/external.rb +11 -11
  13. data/lib/sorcery/controller/submodules/http_basic_auth.rb +7 -2
  14. data/lib/sorcery/controller/submodules/remember_me.rb +2 -1
  15. data/lib/sorcery/controller/submodules/session_timeout.rb +2 -2
  16. data/lib/sorcery/controller.rb +36 -18
  17. data/lib/sorcery/crypto_providers/aes256.rb +4 -2
  18. data/lib/sorcery/crypto_providers/bcrypt.rb +2 -1
  19. data/lib/sorcery/crypto_providers/md5.rb +1 -0
  20. data/lib/sorcery/crypto_providers/sha1.rb +1 -0
  21. data/lib/sorcery/crypto_providers/sha256.rb +1 -0
  22. data/lib/sorcery/crypto_providers/sha512.rb +1 -0
  23. data/lib/sorcery/engine.rb +6 -4
  24. data/lib/sorcery/errors.rb +10 -0
  25. data/lib/sorcery/model/config.rb +20 -31
  26. data/lib/sorcery/model/submodules/activity_logging.rb +8 -6
  27. data/lib/sorcery/model/submodules/brute_force_protection.rb +16 -14
  28. data/lib/sorcery/model/submodules/external.rb +8 -10
  29. data/lib/sorcery/model/submodules/magic_login.rb +8 -4
  30. data/lib/sorcery/model/submodules/remember_me.rb +3 -3
  31. data/lib/sorcery/model/submodules/reset_password.rb +21 -13
  32. data/lib/sorcery/model/submodules/user_activation.rb +19 -17
  33. data/lib/sorcery/model/temporary_token.rb +5 -5
  34. data/lib/sorcery/model.rb +21 -25
  35. data/lib/sorcery/providers/base.rb +1 -1
  36. data/lib/sorcery/providers/facebook.rb +2 -2
  37. data/lib/sorcery/providers/github.rb +3 -3
  38. data/lib/sorcery/providers/heroku.rb +1 -2
  39. data/lib/sorcery/providers/jira.rb +3 -2
  40. data/lib/sorcery/providers/line.rb +2 -4
  41. data/lib/sorcery/providers/microsoft.rb +1 -1
  42. data/lib/sorcery/providers/twitter.rb +2 -2
  43. data/lib/sorcery/providers/vk.rb +4 -4
  44. data/lib/sorcery/providers/xing.rb +3 -2
  45. data/lib/sorcery/test_helpers/internal/rails.rb +5 -22
  46. data/lib/sorcery/test_helpers/internal.rb +4 -6
  47. data/lib/sorcery/test_helpers/rails/integration.rb +1 -1
  48. data/lib/sorcery/test_helpers/rails/request.rb +1 -1
  49. data/lib/sorcery/version.rb +1 -1
  50. data/lib/sorcery.rb +6 -1
  51. metadata +21 -150
  52. data/.devcontainer/Dockerfile +0 -10
  53. data/.devcontainer/devcontainer.json +0 -29
  54. data/.devcontainer/postcreate.sh +0 -4
  55. data/.document +0 -5
  56. data/.github/FUNDING.yml +0 -1
  57. data/.github/ISSUE_TEMPLATE.md +0 -24
  58. data/.github/PULL_REQUEST_TEMPLATE.md +0 -7
  59. data/.github/workflows/ruby.yml +0 -54
  60. data/.gitignore +0 -60
  61. data/.rspec +0 -1
  62. data/.rubocop.yml +0 -55
  63. data/.rubocop_todo.yml +0 -163
  64. data/CODE_OF_CONDUCT.md +0 -14
  65. data/Gemfile +0 -8
  66. data/MAINTAINING.md +0 -64
  67. data/Rakefile +0 -8
  68. data/SECURITY.md +0 -19
  69. data/gemfiles/rails_61.gemfile +0 -7
  70. data/gemfiles/rails_70.gemfile +0 -7
  71. data/gemfiles/rails_71.gemfile +0 -7
  72. data/sorcery.gemspec +0 -49
  73. data/spec/active_record/user_activation_spec.rb +0 -17
  74. data/spec/active_record/user_activity_logging_spec.rb +0 -15
  75. data/spec/active_record/user_brute_force_protection_spec.rb +0 -15
  76. data/spec/active_record/user_magic_login_spec.rb +0 -15
  77. data/spec/active_record/user_oauth_spec.rb +0 -15
  78. data/spec/active_record/user_remember_me_spec.rb +0 -15
  79. data/spec/active_record/user_reset_password_spec.rb +0 -15
  80. data/spec/active_record/user_spec.rb +0 -27
  81. data/spec/controllers/controller_activity_logging_spec.rb +0 -113
  82. data/spec/controllers/controller_brute_force_protection_spec.rb +0 -41
  83. data/spec/controllers/controller_http_basic_auth_spec.rb +0 -67
  84. data/spec/controllers/controller_oauth2_spec.rb +0 -568
  85. data/spec/controllers/controller_oauth_spec.rb +0 -266
  86. data/spec/controllers/controller_remember_me_spec.rb +0 -130
  87. data/spec/controllers/controller_session_timeout_spec.rb +0 -168
  88. data/spec/controllers/controller_spec.rb +0 -200
  89. data/spec/orm/active_record.rb +0 -21
  90. data/spec/providers/example_provider_spec.rb +0 -17
  91. data/spec/providers/example_spec.rb +0 -17
  92. data/spec/providers/examples_spec.rb +0 -17
  93. data/spec/providers/vk_spec.rb +0 -42
  94. data/spec/rails_app/app/active_record/authentication.rb +0 -3
  95. data/spec/rails_app/app/active_record/user.rb +0 -5
  96. data/spec/rails_app/app/active_record/user_provider.rb +0 -3
  97. data/spec/rails_app/app/assets/config/manifest.js +0 -1
  98. data/spec/rails_app/app/controllers/application_controller.rb +0 -2
  99. data/spec/rails_app/app/controllers/sorcery_controller.rb +0 -489
  100. data/spec/rails_app/app/helpers/application_helper.rb +0 -2
  101. data/spec/rails_app/app/mailers/sorcery_mailer.rb +0 -38
  102. data/spec/rails_app/app/views/application/index.html.erb +0 -17
  103. data/spec/rails_app/app/views/layouts/application.html.erb +0 -14
  104. data/spec/rails_app/app/views/sorcery_mailer/activation_email.html.erb +0 -17
  105. data/spec/rails_app/app/views/sorcery_mailer/activation_email.text.erb +0 -9
  106. data/spec/rails_app/app/views/sorcery_mailer/activation_needed_email.html.erb +0 -17
  107. data/spec/rails_app/app/views/sorcery_mailer/activation_success_email.html.erb +0 -17
  108. data/spec/rails_app/app/views/sorcery_mailer/activation_success_email.text.erb +0 -9
  109. data/spec/rails_app/app/views/sorcery_mailer/magic_login_email.html.erb +0 -13
  110. data/spec/rails_app/app/views/sorcery_mailer/magic_login_email.text.erb +0 -6
  111. data/spec/rails_app/app/views/sorcery_mailer/reset_password_email.html.erb +0 -16
  112. data/spec/rails_app/app/views/sorcery_mailer/reset_password_email.text.erb +0 -8
  113. data/spec/rails_app/app/views/sorcery_mailer/send_unlock_token_email.text.erb +0 -1
  114. data/spec/rails_app/config/application.rb +0 -61
  115. data/spec/rails_app/config/boot.rb +0 -4
  116. data/spec/rails_app/config/database.yml +0 -22
  117. data/spec/rails_app/config/environment.rb +0 -5
  118. data/spec/rails_app/config/environments/test.rb +0 -37
  119. data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  120. data/spec/rails_app/config/initializers/compatible_legacy_migration.rb +0 -11
  121. data/spec/rails_app/config/initializers/inflections.rb +0 -10
  122. data/spec/rails_app/config/initializers/mime_types.rb +0 -5
  123. data/spec/rails_app/config/initializers/session_store.rb +0 -12
  124. data/spec/rails_app/config/locales/en.yml +0 -5
  125. data/spec/rails_app/config/routes.rb +0 -81
  126. data/spec/rails_app/config/secrets.yml +0 -4
  127. data/spec/rails_app/config.ru +0 -4
  128. data/spec/rails_app/db/migrate/activation/20101224223622_add_activation_to_users.rb +0 -17
  129. data/spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -19
  130. data/spec/rails_app/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -13
  131. data/spec/rails_app/db/migrate/core/20101224223620_create_users.rb +0 -16
  132. data/spec/rails_app/db/migrate/external/20101224223628_create_authentications_and_user_providers.rb +0 -22
  133. data/spec/rails_app/db/migrate/invalidate_active_sessions/20180221093235_add_invalidate_active_sessions_before_to_users.rb +0 -9
  134. data/spec/rails_app/db/migrate/magic_login/20170924151831_add_magic_login_to_users.rb +0 -17
  135. data/spec/rails_app/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -15
  136. data/spec/rails_app/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -15
  137. data/spec/rails_app/db/schema.rb +0 -21
  138. data/spec/rails_app/db/seeds.rb +0 -7
  139. data/spec/shared_examples/user_activation_shared_examples.rb +0 -361
  140. data/spec/shared_examples/user_activity_logging_shared_examples.rb +0 -106
  141. data/spec/shared_examples/user_brute_force_protection_shared_examples.rb +0 -151
  142. data/spec/shared_examples/user_magic_login_shared_examples.rb +0 -150
  143. data/spec/shared_examples/user_oauth_shared_examples.rb +0 -33
  144. data/spec/shared_examples/user_remember_me_shared_examples.rb +0 -129
  145. data/spec/shared_examples/user_reset_password_shared_examples.rb +0 -370
  146. data/spec/shared_examples/user_shared_examples.rb +0 -678
  147. data/spec/sorcery_crypto_providers_spec.rb +0 -245
  148. data/spec/sorcery_temporary_token_spec.rb +0 -27
  149. data/spec/spec.opts +0 -2
  150. data/spec/spec_helper.rb +0 -50
  151. data/spec/support/migration_helper.rb +0 -29
  152. data/spec/support/providers/example.rb +0 -11
  153. data/spec/support/providers/example_provider.rb +0 -11
  154. data/spec/support/providers/examples.rb +0 -11
@@ -1,61 +0,0 @@
1
- require File.expand_path('boot', __dir__)
2
-
3
- require 'action_controller/railtie'
4
- require 'action_mailer/railtie'
5
- require 'rails/test_unit/railtie'
6
-
7
- Bundler.require :default, SORCERY_ORM
8
-
9
- # rubocop:disable Lint/HandleExceptions
10
- begin
11
- require "#{SORCERY_ORM}/railtie"
12
- rescue LoadError
13
- # TODO: Log this issue or change require scheme.
14
- end
15
- # rubocop:enable Lint/HandleExceptions
16
-
17
- require 'sorcery'
18
-
19
- module AppRoot
20
- class Application < Rails::Application
21
- config.autoload_paths.reject! { |p| p =~ %r{/\/app\/(\w+)$/} && !%w[controllers helpers mailers views].include?(Regexp.last_match(1)) }
22
- config.autoload_paths += ["#{config.root}/app/#{SORCERY_ORM}"]
23
-
24
- # Settings in config/environments/* take precedence over those specified here.
25
- # Application configuration should go into files in config/initializers
26
- # -- all .rb files in that directory are automatically loaded.
27
-
28
- # Custom directories with classes and modules you want to be autoloadable.
29
- # config.autoload_paths += %W(#{config.root}/extras)
30
-
31
- # Only load the plugins named here, in the order given (default is alphabetical).
32
- # :all can be used as a placeholder for all plugins not explicitly named.
33
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
34
-
35
- # Activate observers that should always be running.
36
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
37
-
38
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
39
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
40
- # config.time_zone = 'Central Time (US & Canada)'
41
-
42
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
43
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
44
- # config.i18n.default_locale = :de
45
-
46
- # JavaScript files you want as :defaults (application.js is always included).
47
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
48
-
49
- # Configure the default encoding used in templates for Ruby 1.9.
50
- config.encoding = 'utf-8'
51
-
52
- # Configure sensitive parameters which will be filtered from the log file.
53
- config.filter_parameters += [:password]
54
-
55
- config.action_mailer.delivery_method = :test
56
- config.active_support.deprecation = :stderr
57
- if Rails.version >= '5.1.0' && config.active_record.sqlite3.present?
58
- config.active_record.sqlite3.represent_boolean_as_integer = true
59
- end
60
- end
61
- end
@@ -1,4 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
3
-
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -1,22 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
- development:
4
- adapter: sqlite3
5
- database: db/development.sqlite3
6
- pool: 5
7
- timeout: 5000
8
-
9
- # Warning: The database defined as "test" will be erased and
10
- # re-generated from your development database when you run "rake".
11
- # Do not set this db to the same as development or production.
12
- test:
13
- adapter: sqlite3
14
- database: db/test.sqlite3
15
- pool: 5
16
- timeout: 5000
17
- # adapter: sqlite3
18
- # database: ":memory:"
19
-
20
- production:
21
- adapter: sqlite3
22
- database: ":memory:"
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('application', __dir__)
3
-
4
- # Initialize the rails application
5
- AppRoot::Application.initialize!
@@ -1,37 +0,0 @@
1
- AppRoot::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
- # Log error messages when you accidentally call methods on nil.
11
- config.whiny_nils = true
12
-
13
- # Show full error reports and disable caching
14
- config.consider_all_requests_local = true
15
- config.action_controller.perform_caching = false
16
-
17
- # Raise exceptions instead of rendering exception templates
18
- config.action_dispatch.show_exceptions = false
19
-
20
- # Disable request forgery protection in test environment
21
- config.action_controller.allow_forgery_protection = false
22
-
23
- # Tell Action Mailer not to deliver emails to the real world.
24
- # The :test delivery method accumulates sent emails in the
25
- # ActionMailer::Base.deliveries array.
26
- config.action_mailer.delivery_method = :test
27
-
28
- # Use SQL instead of Active Record's schema dumper when creating the test database.
29
- # This is necessary if your schema can't be completely dumped by the schema dumper,
30
- # like if you have constraints or database-specific column types
31
- # config.active_record.schema_format = :sql
32
-
33
- # Print deprecation notices to the stderr
34
- config.active_support.deprecation = :stderr
35
-
36
- config.eager_load = false
37
- end
@@ -1,7 +0,0 @@
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!
@@ -1,11 +0,0 @@
1
- module ActiveRecord
2
- module CompatibleLegacyMigration
3
- def self.migration_class
4
- if Rails::VERSION::MAJOR >= 5
5
- ActiveRecord::Migration::Current
6
- else
7
- ActiveRecord::Migration
8
- end
9
- end
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
@@ -1,5 +0,0 @@
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
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,12 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- AppRoot::Application.config.session_store :cookie_store, key: '_app_root_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # AppRoot::Application.config.session_store :active_record_store
9
-
10
- if AppRoot::Application.config.respond_to?(:secret_key_base=)
11
- AppRoot::Application.config.secret_key_base = 'foobar'
12
- end
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,81 +0,0 @@
1
- AppRoot::Application.routes.draw do
2
- root to: 'application#index'
3
-
4
- controller :sorcery do
5
- get :test_login
6
- get :test_logout
7
- get :some_action
8
- post :test_return_to
9
- get :test_auto_login
10
- post :test_login_with_remember_in_login
11
- get :test_login_from_cookie
12
- get :test_login_from
13
- get :test_logout_with_remember
14
- get :test_logout_with_forget_me
15
- get :test_logout_with_force_forget_me
16
- get :test_invalidate_active_session
17
- get :test_should_be_logged_in
18
- get :test_create_from_provider
19
- get :test_add_second_provider
20
- get :test_return_to_with_external
21
- get :test_login_from
22
- get :test_login_from_twitter
23
- get :test_login_from_facebook
24
- get :test_login_from_github
25
- get :test_login_from_paypal
26
- get :test_login_from_wechat
27
- get :test_login_from_microsoft
28
- get :test_login_from_google
29
- get :test_login_from_liveid
30
- get :test_login_from_vk
31
- get :test_login_from_jira
32
- get :test_login_from_salesforce
33
- get :test_login_from_slack
34
- get :test_login_from_instagram
35
- get :test_login_from_auth0
36
- get :test_login_from_line
37
- get :test_login_from_discord
38
- get :test_login_from_battlenet
39
- get :login_at_test
40
- get :login_at_test_twitter
41
- get :login_at_test_facebook
42
- get :login_at_test_github
43
- get :login_at_test_paypal
44
- get :login_at_test_wechat
45
- get :login_at_test_microsoft
46
- get :login_at_test_google
47
- get :login_at_test_liveid
48
- get :login_at_test_vk
49
- get :login_at_test_jira
50
- get :login_at_test_salesforce
51
- get :login_at_test_slack
52
- get :login_at_test_instagram
53
- get :login_at_test_auth0
54
- get :login_at_test_line
55
- get :login_at_test_discord
56
- get :login_at_test_battlenet
57
- get :test_return_to_with_external
58
- get :test_return_to_with_external_twitter
59
- get :test_return_to_with_external_facebook
60
- get :test_return_to_with_external_github
61
- get :test_return_to_with_external_paypal
62
- get :test_return_to_with_external_wechat
63
- get :test_return_to_with_external_microsoft
64
- get :test_return_to_with_external_google
65
- get :test_return_to_with_external_liveid
66
- get :test_return_to_with_external_vk
67
- get :test_return_to_with_external_jira
68
- get :test_return_to_with_external_salesforce
69
- get :test_return_to_with_external_slack
70
- get :test_return_to_with_external_instagram
71
- get :test_return_to_with_external_auth0
72
- get :test_return_to_with_external_line
73
- get :test_return_to_with_external_discord
74
- get :test_return_to_with_external_battlenet
75
- get :test_http_basic_auth
76
- get :some_action_making_a_non_persisted_change_to_the_user
77
- post :test_login_with_remember
78
- get :test_create_from_provider_with_block
79
- get :login_at_test_with_state
80
- end
81
- end
@@ -1,4 +0,0 @@
1
- # secrets.yml
2
-
3
- test:
4
- secret_key_base: 'a9789f869a0d0ac2f2b683d6e9410c530696b178bca28a7971f4a652b14ff2da89f2cf4dcbf0355f6bc41f81731aa8e46085674d1acc1980436f61cdba76ff5d'
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run RailsApp::Application
@@ -1,17 +0,0 @@
1
- class AddActivationToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- add_column :users, :activation_state, :string, default: nil
4
- add_column :users, :activation_token, :string, default: nil
5
- add_column :users, :activation_token_expires_at, :datetime, default: nil
6
-
7
- add_index :users, :activation_token
8
- end
9
-
10
- def self.down
11
- remove_index :users, :activation_token
12
-
13
- remove_column :users, :activation_token_expires_at
14
- remove_column :users, :activation_token
15
- remove_column :users, :activation_state
16
- end
17
- end
@@ -1,19 +0,0 @@
1
- class AddActivityLoggingToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- add_column :users, :last_login_at, :datetime, default: nil
4
- add_column :users, :last_logout_at, :datetime, default: nil
5
- add_column :users, :last_activity_at, :datetime, default: nil
6
- add_column :users, :last_login_from_ip_address, :string, default: nil
7
-
8
- add_index :users, %i[last_logout_at last_activity_at]
9
- end
10
-
11
- def self.down
12
- remove_index :users, %i[last_logout_at last_activity_at]
13
-
14
- remove_column :users, :last_activity_at
15
- remove_column :users, :last_logout_at
16
- remove_column :users, :last_login_at
17
- remove_column :users, :last_login_from_ip_address
18
- end
19
- end
@@ -1,13 +0,0 @@
1
- class AddBruteForceProtectionToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- add_column :users, :failed_logins_count, :integer, default: 0
4
- add_column :users, :lock_expires_at, :datetime, default: nil
5
- add_column :users, :unlock_token, :string, default: nil
6
- end
7
-
8
- def self.down
9
- remove_column :users, :unlock_token
10
- remove_column :users, :lock_expires_at
11
- remove_column :users, :failed_logins_count
12
- end
13
- end
@@ -1,16 +0,0 @@
1
- class CreateUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- create_table :users do |t|
4
- t.string :username, null: false
5
- t.string :email, default: nil
6
- t.string :crypted_password
7
- t.string :salt
8
-
9
- t.timestamps null: false
10
- end
11
- end
12
-
13
- def self.down
14
- drop_table :users
15
- end
16
- end
@@ -1,22 +0,0 @@
1
- class CreateAuthenticationsAndUserProviders < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- create_table :authentications do |t|
4
- t.integer :user_id, null: false
5
- t.string :provider, :uid, null: false
6
-
7
- t.timestamps null: false
8
- end
9
-
10
- create_table :user_providers do |t|
11
- t.integer :user_id, null: false
12
- t.string :provider, :uid, null: false
13
-
14
- t.timestamps null: false
15
- end
16
- end
17
-
18
- def self.down
19
- drop_table :authentications
20
- drop_table :user_providers
21
- end
22
- end
@@ -1,9 +0,0 @@
1
- class AddInvalidateSessionsBeforeToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- add_column :users, :invalidate_sessions_before, :datetime, default: nil
4
- end
5
-
6
- def self.down
7
- remove_column :users, :invalidate_sessions_before
8
- end
9
- end
@@ -1,17 +0,0 @@
1
- class AddMagicLoginToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- add_column :users, :magic_login_token, :string, default: nil
4
- add_column :users, :magic_login_token_expires_at, :datetime, default: nil
5
- add_column :users, :magic_login_email_sent_at, :datetime, default: nil
6
-
7
- add_index :users, :magic_login_token
8
- end
9
-
10
- def self.down
11
- remove_index :users, :magic_login_token
12
-
13
- remove_column :users, :magic_login_token
14
- remove_column :users, :magic_login_token_expires_at
15
- remove_column :users, :magic_login_email_sent_at
16
- end
17
- end
@@ -1,15 +0,0 @@
1
- class AddRememberMeTokenToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- add_column :users, :remember_me_token, :string, default: nil
4
- add_column :users, :remember_me_token_expires_at, :datetime, default: nil
5
-
6
- add_index :users, :remember_me_token
7
- end
8
-
9
- def self.down
10
- remove_index :users, :remember_me_token
11
-
12
- remove_column :users, :remember_me_token_expires_at
13
- remove_column :users, :remember_me_token
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- class AddResetPasswordToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
2
- def self.up
3
- add_column :users, :reset_password_token, :string, default: nil
4
- add_column :users, :reset_password_token_expires_at, :datetime, default: nil
5
- add_column :users, :reset_password_email_sent_at, :datetime, default: nil
6
- add_column :users, :access_count_to_reset_password_page, :integer, default: 0
7
- end
8
-
9
- def self.down
10
- remove_column :users, :reset_password_email_sent_at
11
- remove_column :users, :reset_password_token_expires_at
12
- remove_column :users, :reset_password_token
13
- remove_column :users, :access_count_to_reset_password_page
14
- end
15
- end
@@ -1,21 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # Note that this schema.rb definition is the authoritative source for your
6
- # database schema. If you need to create the application database on another
7
- # system, you should be using db:schema:load, not running all the migrations
8
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
- # you'll amass, the slower it'll run and the greater likelihood for issues).
10
- #
11
- # It's strongly recommended to check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 20_101_224_223_620) do
14
- create_table 'users', force: true do |t|
15
- t.string 'username'
16
- t.string 'email'
17
- t.string 'crypted_password'
18
- t.datetime 'created_at'
19
- t.datetime 'updated_at'
20
- end
21
- end
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
- # Mayor.create(:name => 'Daley', :city => cities.first)