devise_token_auth 0.1.43 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +42 -895
  3. data/Rakefile +11 -4
  4. data/app/controllers/devise_token_auth/application_controller.rb +19 -8
  5. data/app/controllers/devise_token_auth/concerns/resource_finder.rb +26 -12
  6. data/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +106 -85
  7. data/app/controllers/devise_token_auth/confirmations_controller.rb +73 -17
  8. data/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +95 -51
  9. data/app/controllers/devise_token_auth/passwords_controller.rb +65 -57
  10. data/app/controllers/devise_token_auth/registrations_controller.rb +61 -61
  11. data/app/controllers/devise_token_auth/sessions_controller.rb +22 -18
  12. data/app/controllers/devise_token_auth/token_validations_controller.rb +5 -3
  13. data/app/controllers/devise_token_auth/unlocks_controller.rb +20 -16
  14. data/app/models/devise_token_auth/concerns/active_record_support.rb +14 -0
  15. data/app/models/devise_token_auth/concerns/confirmable_support.rb +28 -0
  16. data/app/models/devise_token_auth/concerns/mongoid_support.rb +19 -0
  17. data/app/models/devise_token_auth/concerns/tokens_serialization.rb +31 -0
  18. data/app/models/devise_token_auth/concerns/user.rb +92 -100
  19. data/app/models/devise_token_auth/concerns/user_omniauth_callbacks.rb +8 -3
  20. data/app/validators/{email_validator.rb → devise_token_auth_email_validator.rb} +5 -3
  21. data/app/views/devise_token_auth/omniauth_external_window.html.erb +1 -1
  22. data/config/locales/da-DK.yml +11 -9
  23. data/config/locales/de.yml +2 -0
  24. data/config/locales/en.yml +10 -0
  25. data/config/locales/es.yml +2 -0
  26. data/config/locales/fr.yml +2 -0
  27. data/config/locales/he.yml +52 -0
  28. data/config/locales/it.yml +2 -0
  29. data/config/locales/ja.yml +4 -2
  30. data/config/locales/ko.yml +51 -0
  31. data/config/locales/nl.yml +2 -0
  32. data/config/locales/pl.yml +6 -3
  33. data/config/locales/pt-BR.yml +2 -0
  34. data/config/locales/pt.yml +6 -3
  35. data/config/locales/ro.yml +2 -0
  36. data/config/locales/ru.yml +2 -0
  37. data/config/locales/sq.yml +2 -0
  38. data/config/locales/sv.yml +52 -0
  39. data/config/locales/uk.yml +2 -0
  40. data/config/locales/vi.yml +2 -0
  41. data/config/locales/zh-CN.yml +2 -0
  42. data/config/locales/zh-HK.yml +2 -0
  43. data/config/locales/zh-TW.yml +2 -0
  44. data/lib/devise_token_auth/blacklist.rb +6 -0
  45. data/lib/devise_token_auth/controllers/helpers.rb +21 -13
  46. data/lib/devise_token_auth/controllers/url_helpers.rb +2 -0
  47. data/lib/devise_token_auth/engine.rb +26 -14
  48. data/lib/devise_token_auth/errors.rb +8 -0
  49. data/lib/devise_token_auth/rails/routes.rb +37 -30
  50. data/lib/devise_token_auth/token_factory.rb +126 -0
  51. data/lib/devise_token_auth/url.rb +11 -4
  52. data/lib/devise_token_auth/version.rb +3 -1
  53. data/lib/devise_token_auth.rb +11 -5
  54. data/lib/generators/devise_token_auth/USAGE +2 -2
  55. data/lib/generators/devise_token_auth/install_generator.rb +36 -105
  56. data/lib/generators/devise_token_auth/install_generator_helpers.rb +98 -0
  57. data/lib/generators/devise_token_auth/install_mongoid_generator.rb +46 -0
  58. data/lib/generators/devise_token_auth/install_views_generator.rb +7 -5
  59. data/lib/generators/devise_token_auth/templates/devise_token_auth.rb +12 -0
  60. data/lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb.erb +8 -14
  61. data/lib/generators/devise_token_auth/templates/user.rb.erb +9 -0
  62. data/lib/generators/devise_token_auth/templates/user_mongoid.rb.erb +56 -0
  63. data/lib/tasks/devise_token_auth_tasks.rake +2 -0
  64. data/test/controllers/custom/custom_confirmations_controller_test.rb +5 -1
  65. data/test/controllers/custom/custom_omniauth_callbacks_controller_test.rb +4 -0
  66. data/test/controllers/custom/custom_passwords_controller_test.rb +6 -2
  67. data/test/controllers/custom/custom_registrations_controller_test.rb +17 -8
  68. data/test/controllers/custom/custom_sessions_controller_test.rb +7 -5
  69. data/test/controllers/custom/custom_token_validations_controller_test.rb +5 -3
  70. data/test/controllers/demo_group_controller_test.rb +4 -6
  71. data/test/controllers/demo_mang_controller_test.rb +3 -3
  72. data/test/controllers/demo_user_controller_test.rb +53 -25
  73. data/test/controllers/devise_token_auth/confirmations_controller_test.rb +159 -25
  74. data/test/controllers/devise_token_auth/omniauth_callbacks_controller_test.rb +117 -47
  75. data/test/controllers/devise_token_auth/passwords_controller_test.rb +309 -126
  76. data/test/controllers/devise_token_auth/registrations_controller_test.rb +65 -23
  77. data/test/controllers/devise_token_auth/sessions_controller_test.rb +93 -61
  78. data/test/controllers/devise_token_auth/token_validations_controller_test.rb +18 -6
  79. data/test/controllers/devise_token_auth/unlocks_controller_test.rb +24 -5
  80. data/test/controllers/overrides/confirmations_controller_test.rb +6 -2
  81. data/test/controllers/overrides/omniauth_callbacks_controller_test.rb +5 -1
  82. data/test/controllers/overrides/passwords_controller_test.rb +27 -29
  83. data/test/controllers/overrides/registrations_controller_test.rb +33 -27
  84. data/test/controllers/overrides/sessions_controller_test.rb +6 -4
  85. data/test/controllers/overrides/token_validations_controller_test.rb +5 -3
  86. data/test/dummy/app/active_record/confirmable_user.rb +11 -0
  87. data/test/dummy/app/{models → active_record}/lockable_user.rb +2 -0
  88. data/test/dummy/app/{models → active_record}/mang.rb +2 -0
  89. data/test/dummy/app/{models → active_record}/only_email_user.rb +2 -0
  90. data/test/dummy/app/{models → active_record}/scoped_user.rb +4 -2
  91. data/test/dummy/app/{models → active_record}/unconfirmable_user.rb +3 -2
  92. data/test/dummy/app/active_record/unregisterable_user.rb +9 -0
  93. data/test/dummy/app/active_record/user.rb +6 -0
  94. data/test/dummy/app/controllers/application_controller.rb +2 -0
  95. data/test/dummy/app/controllers/auth_origin_controller.rb +2 -0
  96. data/test/dummy/app/controllers/custom/confirmations_controller.rb +2 -2
  97. data/test/dummy/app/controllers/custom/omniauth_callbacks_controller.rb +2 -0
  98. data/test/dummy/app/controllers/custom/passwords_controller.rb +3 -4
  99. data/test/dummy/app/controllers/custom/registrations_controller.rb +3 -3
  100. data/test/dummy/app/controllers/custom/sessions_controller.rb +3 -3
  101. data/test/dummy/app/controllers/custom/token_validations_controller.rb +3 -3
  102. data/test/dummy/app/controllers/demo_group_controller.rb +2 -0
  103. data/test/dummy/app/controllers/demo_mang_controller.rb +2 -0
  104. data/test/dummy/app/controllers/demo_user_controller.rb +2 -0
  105. data/test/dummy/app/controllers/overrides/confirmations_controller.rb +8 -6
  106. data/test/dummy/app/controllers/overrides/omniauth_callbacks_controller.rb +5 -3
  107. data/test/dummy/app/controllers/overrides/passwords_controller.rb +10 -8
  108. data/test/dummy/app/controllers/overrides/registrations_controller.rb +5 -3
  109. data/test/dummy/app/controllers/overrides/sessions_controller.rb +12 -12
  110. data/test/dummy/app/controllers/overrides/token_validations_controller.rb +5 -5
  111. data/test/dummy/app/helpers/application_helper.rb +1029 -1036
  112. data/test/dummy/app/models/{user.rb → concerns/favorite_color.rb} +8 -7
  113. data/test/dummy/app/mongoid/confirmable_user.rb +52 -0
  114. data/test/dummy/app/mongoid/lockable_user.rb +38 -0
  115. data/test/dummy/app/mongoid/mang.rb +46 -0
  116. data/test/dummy/app/mongoid/only_email_user.rb +33 -0
  117. data/test/dummy/app/mongoid/scoped_user.rb +50 -0
  118. data/test/dummy/app/mongoid/unconfirmable_user.rb +44 -0
  119. data/test/dummy/app/mongoid/unregisterable_user.rb +47 -0
  120. data/test/dummy/app/mongoid/user.rb +49 -0
  121. data/test/dummy/app/views/layouts/application.html.erb +0 -2
  122. data/test/dummy/config/application.rb +26 -3
  123. data/test/dummy/config/boot.rb +8 -2
  124. data/test/dummy/config/environment.rb +3 -1
  125. data/test/dummy/config/environments/development.rb +5 -13
  126. data/test/dummy/config/environments/production.rb +2 -16
  127. data/test/dummy/config/environments/test.rb +3 -1
  128. data/test/dummy/config/initializers/backtrace_silencers.rb +2 -0
  129. data/test/dummy/config/initializers/cookies_serializer.rb +3 -1
  130. data/test/dummy/config/initializers/devise.rb +287 -0
  131. data/test/dummy/config/initializers/devise_token_auth.rb +37 -4
  132. data/test/dummy/config/initializers/figaro.rb +3 -1
  133. data/test/dummy/config/initializers/filter_parameter_logging.rb +2 -0
  134. data/test/dummy/config/initializers/inflections.rb +2 -0
  135. data/test/dummy/config/initializers/mime_types.rb +2 -0
  136. data/test/dummy/config/initializers/omniauth.rb +5 -2
  137. data/test/dummy/config/initializers/session_store.rb +2 -0
  138. data/test/dummy/config/initializers/wrap_parameters.rb +2 -0
  139. data/test/dummy/config/routes.rb +14 -29
  140. data/test/dummy/config/spring.rb +2 -0
  141. data/test/dummy/config.ru +5 -3
  142. data/test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb +9 -14
  143. data/test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb +8 -13
  144. data/test/dummy/db/migrate/20140829044006_add_operating_thetan_to_user.rb +2 -0
  145. data/test/dummy/db/migrate/20140916224624_add_favorite_color_to_mangs.rb +2 -0
  146. data/test/dummy/db/migrate/20141222035835_devise_token_auth_create_only_email_users.rb +6 -11
  147. data/test/dummy/db/migrate/20141222053502_devise_token_auth_create_unregisterable_users.rb +8 -13
  148. data/test/dummy/db/migrate/20150708104536_devise_token_auth_create_unconfirmable_users.rb +8 -13
  149. data/test/dummy/db/migrate/20160103235141_devise_token_auth_create_scoped_users.rb +8 -13
  150. data/test/dummy/db/migrate/20160629184441_devise_token_auth_create_lockable_users.rb +8 -13
  151. data/test/dummy/{tmp/generators/db/migrate/20171014052631_devise_token_auth_create_users.rb → db/migrate/20190924101113_devise_token_auth_create_confirmable_users.rb} +8 -14
  152. data/test/dummy/db/schema.rb +11 -71
  153. data/test/dummy/lib/migration_database_helper.rb +15 -1
  154. data/test/dummy/tmp/generators/app/controllers/application_controller.rb +6 -0
  155. data/test/dummy/tmp/generators/app/models/azpire/v1/human_resource/user.rb +56 -0
  156. data/test/dummy/tmp/generators/config/initializers/devise_token_auth.rb +12 -0
  157. data/test/factories/users.rb +41 -0
  158. data/test/lib/devise_token_auth/blacklist_test.rb +19 -0
  159. data/test/lib/devise_token_auth/rails/custom_routes_test.rb +29 -0
  160. data/test/lib/devise_token_auth/rails/routes_test.rb +87 -0
  161. data/test/lib/devise_token_auth/token_factory_test.rb +191 -0
  162. data/test/lib/devise_token_auth/url_test.rb +9 -7
  163. data/test/lib/generators/devise_token_auth/install_generator_test.rb +67 -37
  164. data/test/lib/generators/devise_token_auth/install_generator_with_namespace_test.rb +222 -0
  165. data/test/lib/generators/devise_token_auth/install_views_generator_test.rb +3 -1
  166. data/test/models/concerns/mongoid_support_test.rb +31 -0
  167. data/test/models/concerns/tokens_serialization_test.rb +104 -0
  168. data/test/models/confirmable_user_test.rb +35 -0
  169. data/test/models/only_email_user_test.rb +2 -8
  170. data/test/models/user_test.rb +18 -79
  171. data/test/support/controllers/routes.rb +43 -0
  172. data/test/test_helper.rb +83 -26
  173. metadata +153 -44
  174. data/config/initializers/devise.rb +0 -196
  175. data/lib/generators/devise_token_auth/templates/user.rb +0 -7
  176. data/test/dummy/app/models/evil_user.rb +0 -3
  177. data/test/dummy/app/models/nice_user.rb +0 -7
  178. data/test/dummy/app/models/unregisterable_user.rb +0 -7
  179. data/test/dummy/config/initializers/assets.rb +0 -8
  180. data/test/dummy/db/migrate/20140928231203_devise_token_auth_create_evil_users.rb +0 -64
  181. data/test/dummy/db/migrate/20150409095712_devise_token_auth_create_nice_users.rb +0 -61
  182. data/test/dummy/tmp/generators/app/models/user.rb +0 -11
  183. data/test/integration/navigation_test.rb +0 -10
@@ -1,196 +0,0 @@
1
- # Use this hook to configure devise mailer, warden hooks and so forth.
2
- # Many of these configuration options can be set straight in your model.
3
- Devise.setup do |config|
4
- # The secret key used by Devise. Devise uses this key to generate
5
- # random tokens. Changing this key will render invalid all existing
6
- # confirmation, reset password and unlock tokens in the database.
7
- # config.secret_key = 'd029dbc7262359b4f9906ec029bae825981dee112d9a1425643719765c8fd4884f12a37add35607fa3fa2d6fa6945a0077d7fe0f10a67f8ee66d69e9cc6ac19b'
8
-
9
- # ==> Mailer Configuration
10
- # Configure the e-mail address which will be shown in Devise::Mailer,
11
- # note that it will be overwritten if you use your own mailer class
12
- # with default "from" parameter.
13
- config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
14
-
15
- # Configure the class responsible to send e-mails.
16
- # config.mailer = 'Devise::Mailer'
17
-
18
- # ==> ORM configuration
19
- # Load and configure the ORM. Supports :active_record (default) and
20
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
21
- # available as additional gems.
22
- require 'devise/orm/active_record'
23
-
24
- # ==> Configuration for any authentication mechanism
25
- # Configure which keys are used when authenticating a user. The default is
26
- # just :email. You can configure it to use [:username, :subdomain], so for
27
- # authenticating a user, both parameters are required. Remember that those
28
- # parameters are used only when authenticating and not when retrieving from
29
- # session. If you need permissions, you should implement that in a before filter.
30
- # You can also supply a hash where the value is a boolean determining whether
31
- # or not authentication should be aborted when the value is not present.
32
- # config.authentication_keys = [ :email ]
33
-
34
- # Configure parameters from the request object used for authentication. Each entry
35
- # given should be a request method and it will automatically be passed to the
36
- # find_for_authentication method and considered in your model lookup. For instance,
37
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
38
- # The same considerations mentioned for authentication_keys also apply to request_keys.
39
- # config.request_keys = []
40
-
41
- # Configure which authentication keys should be case-insensitive.
42
- # These keys will be downcased upon creating or modifying a user and when used
43
- # to authenticate or find a user. Default is :email.
44
- config.case_insensitive_keys = [ :email ]
45
-
46
- # Configure which authentication keys should have whitespace stripped.
47
- # These keys will have whitespace before and after removed upon creating or
48
- # modifying a user and when used to authenticate or find a user. Default is :email.
49
- config.strip_whitespace_keys = [ :email ]
50
-
51
- # Tell if authentication through request.params is enabled. True by default.
52
- # It can be set to an array that will enable params authentication only for the
53
- # given strategies, for example, `config.params_authenticatable = [:database]` will
54
- # enable it only for database (email + password) authentication.
55
- # config.params_authenticatable = true
56
-
57
- # Tell if authentication through HTTP Auth is enabled. False by default.
58
- # It can be set to an array that will enable http authentication only for the
59
- # given strategies, for example, `config.http_authenticatable = [:database]` will
60
- # enable it only for database authentication. The supported strategies are:
61
- # :database = Support basic authentication with authentication key + password
62
- # config.http_authenticatable = false
63
-
64
- # If http headers should be returned for AJAX requests. True by default.
65
- # config.http_authenticatable_on_xhr = true
66
-
67
- # The realm used in Http Basic Authentication. 'Application' by default.
68
- # config.http_authentication_realm = 'Application'
69
-
70
- # It will change confirmation, password recovery and other workflows
71
- # to behave the same regardless if the e-mail provided was right or wrong.
72
- # Does not affect registerable.
73
- # config.paranoid = true
74
-
75
- # By default Devise will store the user in session. You can skip storage for
76
- # particular strategies by setting this option.
77
- # Notice that if you are skipping storage for all authentication paths, you
78
- # may want to disable generating routes to Devise's sessions controller by
79
- # passing skip: :sessions to `devise_for` in your config/routes.rb
80
- config.skip_session_storage = [:http_auth]
81
-
82
- # By default, Devise cleans up the CSRF token on authentication to
83
- # avoid CSRF token fixation attacks. This means that, when using AJAX
84
- # requests for sign in and sign up, you need to get a new CSRF token
85
- # from the server. You can disable this option at your own risk.
86
- # config.clean_up_csrf_token_on_authentication = true
87
-
88
- # ==> Configuration for :database_authenticatable
89
- # For bcrypt, this is the cost for hashing the password and defaults to 11. If
90
- # using other algorithms, it sets how many times you want the password to be hashed.
91
- #
92
- # Limiting the stretches to just one in testing will increase the performance of
93
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
94
- # a value less than 10 in other environments. Note that, for bcrypt (the default
95
- # algorithm), the cost increases exponentially with the number of stretches (e.g.
96
- # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
97
- config.stretches = Rails.env.test? ? 1 : 11
98
-
99
- # Setup a pepper to generate the encrypted password.
100
- # config.pepper = '8ff086600aff82d68ff1e00d23c99c821e66652ec8c2a5b48f58de4a56b325cb532f6db660cf58fc5ecb473b9d851be8cd1badff0a1053bc9dc045f78b6e6772'
101
-
102
- # ==> Configuration for :confirmable
103
- # A period that the user is allowed to access the website even without
104
- # confirming their account. For instance, if set to 2.days, the user will be
105
- # able to access the website for two days without confirming their account,
106
- # access will be blocked just in the third day. Default is 0.days, meaning
107
- # the user cannot access the website without confirming their account.
108
- # config.allow_unconfirmed_access_for = 2.days
109
-
110
- # A period that the user is allowed to confirm their account before their
111
- # token becomes invalid. For example, if set to 3.days, the user can confirm
112
- # their account within 3 days after the mail was sent, but on the fourth day
113
- # their account can't be confirmed with the token any more.
114
- # Default is nil, meaning there is no restriction on how long a user can take
115
- # before confirming their account.
116
- # config.confirm_within = 3.days
117
-
118
- # If true, requires any email changes to be confirmed (exactly the same way as
119
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
120
- # db field (see migrations). Until confirmed, new email is stored in
121
- # unconfirmed_email column, and copied to email column on successful confirmation.
122
- config.reconfirmable = true
123
-
124
- # Defines which key will be used when confirming an account
125
- # config.confirmation_keys = [ :email ]
126
-
127
- # ==> Configuration for :rememberable
128
- # The time the user will be remembered without asking for credentials again.
129
- # config.remember_for = 2.weeks
130
-
131
- # If true, extends the user's remember period when remembered via cookie.
132
- # config.extend_remember_period = false
133
-
134
- # Options to be passed to the created cookie. For instance, you can set
135
- # secure: true in order to force SSL only cookies.
136
- # config.rememberable_options = {}
137
-
138
- # ==> Configuration for :validatable
139
- # Range for password length.
140
- config.password_length = 8..128
141
-
142
- # Email regex used to validate email formats. It simply asserts that
143
- # one (and only one) @ exists in the given string. This is mainly
144
- # to give user feedback and not to assert the e-mail validity.
145
- config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
146
-
147
- # ==> Configuration for :timeoutable
148
- # The time you want to timeout the user session without activity. After this
149
- # time the user will be asked for credentials again. Default is 30 minutes.
150
- # config.timeout_in = 30.minutes
151
-
152
- # If true, expires auth token on session timeout.
153
- # config.expire_auth_token_on_timeout = false
154
-
155
- # ==> Configuration for :lockable
156
- # Defines which strategy will be used to lock an account.
157
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
158
- # :none = No lock strategy. You should handle locking by yourself.
159
- # config.lock_strategy = :failed_attempts
160
-
161
- # Defines which key will be used when locking and unlocking an account
162
- # config.unlock_keys = [ :email ]
163
-
164
- # Defines which strategy will be used to unlock an account.
165
- # :email = Sends an unlock link to the user email
166
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
167
- # :both = Enables both strategies
168
- # :none = No unlock strategy. You should handle unlocking by yourself.
169
- # config.unlock_strategy = :both
170
-
171
- # Number of authentication tries before locking an account if lock_strategy
172
- # is failed attempts.
173
- # config.maximum_attempts = 20
174
-
175
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
176
- # config.unlock_in = 1.hour
177
-
178
- # Warn on the last attempt before the account is locked.
179
- # config.last_attempt_warning = false
180
-
181
- # ==> Configuration for :recoverable
182
- #
183
- # Defines which key will be used when recovering the password for an account
184
- # config.reset_password_keys = [ :email ]
185
-
186
- # Time interval you can reset your password with a reset password key.
187
- # Don't put a too small interval or your users won't have the time to
188
- # change their passwords.
189
- config.reset_password_within = 6.hours
190
-
191
- # The default HTTP method used to sign out a resource. Default is :delete.
192
- config.sign_out_via = :delete
193
-
194
- # don't serialize tokens
195
- Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION << :tokens
196
- end
@@ -1,7 +0,0 @@
1
- class <%= user_class.capitalize %> < ActiveRecord::Base
2
- # Include default devise modules. Others available are:
3
- # :confirmable, :lockable, :timeoutable and :omniauthable
4
- devise :database_authenticatable, :registerable,
5
- :recoverable, :rememberable, :trackable, :validatable
6
- include DeviseTokenAuth::Concerns::User
7
- end
@@ -1,3 +0,0 @@
1
- class EvilUser < ActiveRecord::Base
2
- include DeviseTokenAuth::Concerns::User
3
- end
@@ -1,7 +0,0 @@
1
- class NiceUser < ActiveRecord::Base
2
- # Include default devise modules.
3
- devise :database_authenticatable, :registerable,
4
- :recoverable, :rememberable, :trackable, :validatable,
5
- :confirmable, :omniauthable
6
- include DeviseTokenAuth::Concerns::User
7
- end
@@ -1,7 +0,0 @@
1
- class UnregisterableUser < ActiveRecord::Base
2
- # Include default devise modules.
3
- devise :database_authenticatable,
4
- :recoverable, :trackable, :validatable,
5
- :confirmable, :omniauthable
6
- include DeviseTokenAuth::Concerns::User
7
- end
@@ -1,8 +0,0 @@
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 )
@@ -1,64 +0,0 @@
1
- include MigrationDatabaseHelper
2
-
3
- class DeviseTokenAuthCreateEvilUsers < ActiveRecord::Migration[4.2]
4
- def change
5
- create_table(:evil_users) do |t|
6
- ## Database authenticatable
7
- t.string :email
8
- t.string :encrypted_password, :null => false, :default => ""
9
-
10
- ## Recoverable
11
- t.string :reset_password_token
12
- t.datetime :reset_password_sent_at
13
- t.boolean :allow_password_change, :default => false
14
-
15
- ## Rememberable
16
- t.datetime :remember_created_at
17
-
18
- ## Trackable
19
- t.integer :sign_in_count, :default => 0, :null => false
20
- t.datetime :current_sign_in_at
21
- t.datetime :last_sign_in_at
22
- t.string :current_sign_in_ip
23
- t.string :last_sign_in_ip
24
-
25
- ## Confirmable
26
- t.string :confirmation_token
27
- t.datetime :confirmed_at
28
- t.datetime :confirmation_sent_at
29
- t.string :unconfirmed_email # Only if using reconfirmable
30
-
31
- ## Lockable
32
- # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
33
- # t.string :unlock_token # Only if unlock strategy is :email or :both
34
- # t.datetime :locked_at
35
-
36
- ## User Info
37
- t.string :name
38
- t.string :nickname
39
- t.string :image
40
-
41
- ## unique oauth id
42
- t.string :provider
43
- t.string :uid, :null => false, :default => ""
44
-
45
- ## Tokens
46
- if json_supported_database?
47
- t.json :tokens
48
- else
49
- t.text :tokens
50
- end
51
-
52
- ## etc.
53
- t.string :favorite_color
54
-
55
- t.timestamps
56
- end
57
-
58
- add_index :evil_users, :email
59
- add_index :evil_users, [:uid, :provider], :unique => true
60
- add_index :evil_users, :reset_password_token, :unique => true
61
- add_index :evil_users, :confirmation_token, :unique => true
62
- # add_index :evil_users, :unlock_token, :unique => true
63
- end
64
- end
@@ -1,61 +0,0 @@
1
- include MigrationDatabaseHelper
2
-
3
- class DeviseTokenAuthCreateNiceUsers < ActiveRecord::Migration[4.2]
4
- def change
5
- create_table(:nice_users) do |t|
6
- ## Required
7
- t.string :provider, :null => false
8
- t.string :uid, :null => false, :default => ""
9
-
10
- ## Database authenticatable
11
- t.string :encrypted_password, :null => false, :default => ""
12
-
13
- ## Recoverable
14
- t.string :reset_password_token
15
- t.datetime :reset_password_sent_at
16
- t.boolean :allow_password_change, :default => false
17
-
18
- ## Rememberable
19
- t.datetime :remember_created_at
20
-
21
- ## Trackable
22
- t.integer :sign_in_count, :default => 0, :null => false
23
- t.datetime :current_sign_in_at
24
- t.datetime :last_sign_in_at
25
- t.string :current_sign_in_ip
26
- t.string :last_sign_in_ip
27
-
28
- ## Confirmable
29
- t.string :confirmation_token
30
- t.datetime :confirmed_at
31
- t.datetime :confirmation_sent_at
32
- t.string :unconfirmed_email # Only if using reconfirmable
33
-
34
- ## Lockable
35
- # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
36
- # t.string :unlock_token # Only if unlock strategy is :email or :both
37
- # t.datetime :locked_at
38
-
39
- ## User Info
40
- t.string :name
41
- t.string :nickname
42
- t.string :image
43
- t.string :email
44
-
45
- ## Tokens
46
- if json_supported_database?
47
- t.json :tokens
48
- else
49
- t.text :tokens
50
- end
51
-
52
- t.timestamps
53
- end
54
-
55
- add_index :nice_users, :email
56
- add_index :nice_users, [:uid, :provider], :unique => true
57
- add_index :nice_users, :reset_password_token, :unique => true
58
- # add_index :nice_users, :confirmation_token, :unique => true
59
- # add_index :nice_users, :unlock_token, :unique => true
60
- end
61
- end
@@ -1,11 +0,0 @@
1
- class User < ApplicationRecord
2
- # Include default devise modules.
3
- devise :database_authenticatable, :registerable,
4
- :recoverable, :rememberable, :trackable, :validatable,
5
- :confirmable, :omniauthable
6
- include DeviseTokenAuth::Concerns::User
7
-
8
- def whatever
9
- puts 'whatever'
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-