introspective_admin 0.1.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.travis.yml +5 -14
- data/CHANGELOG.md +37 -28
- data/Gemfile +15 -6
- data/Gemfile.lock +347 -264
- data/README.md +34 -8
- data/introspective_admin.gemspec +34 -44
- data/lib/introspective_admin/base.rb +200 -200
- data/lib/introspective_admin/version.rb +3 -3
- data/spec/admin/company_admin_spec.rb +72 -72
- data/spec/admin/job_admin_spec.rb +61 -61
- data/spec/admin/location_admin_spec.rb +66 -66
- data/spec/admin/location_beacon_admin_spec.rb +73 -73
- data/spec/admin/project__admin_spec.rb +71 -71
- data/spec/admin/user_admin_spec.rb +64 -64
- data/spec/dummy/Gemfile +15 -0
- data/spec/dummy/README.rdoc +28 -28
- data/spec/dummy/Rakefile +6 -6
- data/spec/dummy/app/admin/admin_users.rb +28 -0
- data/spec/dummy/app/admin/company_admin.rb +4 -4
- data/spec/dummy/app/admin/dashboard.rb +32 -0
- data/spec/dummy/app/admin/job_admin.rb +4 -4
- data/spec/dummy/app/admin/location_admin.rb +4 -4
- data/spec/dummy/app/admin/location_beacon_admin.rb +6 -6
- data/spec/dummy/app/admin/project_admin.rb +6 -6
- data/spec/dummy/app/admin/role_admin.rb +5 -5
- data/spec/dummy/app/admin/user_admin.rb +13 -13
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/javascripts/active_admin.js +1 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -13
- data/spec/dummy/app/assets/stylesheets/active_admin.scss +17 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -15
- data/spec/dummy/app/controllers/application_controller.rb +8 -8
- data/spec/dummy/app/helpers/application_helper.rb +3 -3
- data/spec/dummy/app/models/abstract_adapter.rb +18 -12
- data/spec/dummy/app/models/admin_user.rb +10 -6
- data/spec/dummy/app/models/company.rb +12 -12
- data/spec/dummy/app/models/job.rb +10 -10
- data/spec/dummy/app/models/locatable.rb +6 -6
- data/spec/dummy/app/models/location.rb +26 -26
- data/spec/dummy/app/models/location_beacon.rb +19 -19
- data/spec/dummy/app/models/location_gps.rb +11 -11
- data/spec/dummy/app/models/project.rb +20 -20
- data/spec/dummy/app/models/project_job.rb +7 -7
- data/spec/dummy/app/models/role.rb +25 -25
- data/spec/dummy/app/models/team.rb +9 -9
- data/spec/dummy/app/models/team_user.rb +13 -13
- data/spec/dummy/app/models/user.rb +68 -68
- data/spec/dummy/app/models/user_location.rb +28 -28
- data/spec/dummy/app/models/user_project_job.rb +16 -16
- data/spec/dummy/app/views/layouts/application.html.erb +13 -13
- data/spec/dummy/bin/bundle +3 -3
- data/spec/dummy/bin/rails +4 -4
- data/spec/dummy/bin/rake +4 -4
- data/spec/dummy/bin/setup +29 -29
- data/spec/dummy/config/application.rb +34 -34
- data/spec/dummy/config/boot.rb +5 -5
- data/spec/dummy/config/database.yml +22 -22
- data/spec/dummy/config/environment.rb +11 -11
- data/spec/dummy/config/environments/development.rb +45 -45
- data/spec/dummy/config/environments/production.rb +82 -82
- data/spec/dummy/config/environments/test.rb +50 -50
- data/spec/dummy/config/initializers/active_admin.rb +7 -7
- data/spec/dummy/config/initializers/assets.rb +13 -13
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -3
- data/spec/dummy/config/initializers/devise.rb +263 -263
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -4
- data/spec/dummy/config/initializers/inflections.rb +16 -16
- data/spec/dummy/config/initializers/mime_types.rb +4 -4
- data/spec/dummy/config/initializers/session_store.rb +3 -3
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
- data/spec/dummy/config/initializers/zeitwerk.rb +8 -0
- data/spec/dummy/config/locales/devise.en.yml +60 -60
- data/spec/dummy/config/locales/en.yml +23 -23
- data/spec/dummy/config/routes.rb +10 -9
- data/spec/dummy/config/secrets.yml +20 -20
- data/spec/dummy/config.ru +4 -4
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/development.sqlite3-shm +0 -0
- data/spec/dummy/db/development.sqlite3-wal +0 -0
- data/spec/dummy/db/migrate/20141002205024_devise_create_users.rb +42 -42
- data/spec/dummy/db/migrate/20141002211055_devise_create_admin_users.rb +48 -48
- data/spec/dummy/db/migrate/20141002211057_create_active_admin_comments.rb +19 -19
- data/spec/dummy/db/migrate/20141002220722_add_lockable_to_users.rb +8 -8
- data/spec/dummy/db/migrate/20150406213646_create_companies.rb +11 -11
- data/spec/dummy/db/migrate/20150414213154_add_user_authentication_token.rb +11 -11
- data/spec/dummy/db/migrate/20150415222005_create_roles.rb +12 -12
- data/spec/dummy/db/migrate/20150505181635_create_chats.rb +9 -9
- data/spec/dummy/db/migrate/20150505181636_create_chat_users.rb +11 -11
- data/spec/dummy/db/migrate/20150505181640_create_chat_messages.rb +11 -11
- data/spec/dummy/db/migrate/20150507191529_create_chat_message_users.rb +11 -11
- data/spec/dummy/db/migrate/20150601200526_create_locations.rb +13 -13
- data/spec/dummy/db/migrate/20150601200533_create_locatables.rb +10 -10
- data/spec/dummy/db/migrate/20150601212924_create_location_beacons.rb +16 -16
- data/spec/dummy/db/migrate/20150601213542_create_location_gps.rb +12 -12
- data/spec/dummy/db/migrate/20150609201823_create_user_locations.rb +14 -14
- data/spec/dummy/db/migrate/20150617232519_create_projects.rb +10 -10
- data/spec/dummy/db/migrate/20150617232521_create_jobs.rb +9 -9
- data/spec/dummy/db/migrate/20150617232522_create_project_jobs.rb +11 -11
- data/spec/dummy/db/migrate/20150623170133_create_user_project_jobs.rb +12 -12
- data/spec/dummy/db/migrate/20150701234929_create_teams.rb +11 -11
- data/spec/dummy/db/migrate/20150701234930_create_team_users.rb +11 -11
- data/spec/dummy/db/migrate/20150727214950_add_confirmable_to_devise.rb +11 -11
- data/spec/dummy/db/migrate/20150820190524_add_user_names.rb +6 -6
- data/spec/dummy/db/migrate/20150909225019_add_password_to_project.rb +5 -5
- data/spec/dummy/db/migrate/20220806003731_add_devise_to_admin_users.rb +51 -0
- data/spec/dummy/db/schema.rb +264 -264
- data/spec/dummy/introspective_admin.gemspec +34 -0
- data/spec/dummy/public/404.html +67 -67
- data/spec/dummy/public/422.html +67 -67
- data/spec/dummy/public/500.html +66 -66
- data/spec/rails_helper.rb +27 -27
- metadata +25 -116
- data/Gemfile.lock.rails4 +0 -256
@@ -1,263 +1,263 @@
|
|
1
|
-
require 'devise'
|
2
|
-
# Use this hook to configure devise mailer, warden hooks and so forth.
|
3
|
-
# Many of these configuration options can be set straight in your model.
|
4
|
-
Devise.setup do |config|
|
5
|
-
# The secret key used by Devise. Devise uses this key to generate
|
6
|
-
# random tokens. Changing this key will render invalid all existing
|
7
|
-
# confirmation, reset password and unlock tokens in the database.
|
8
|
-
# Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
|
9
|
-
# by default. You can change it below and use your own secret key.
|
10
|
-
config.secret_key = '16f3eba693fcd1a875d60e96961501c7e78eb7167a68bdff3bb0fa14b66f985f0e07cccbb2c38ca105b71a4ab051adf35d5f7b368172e02a138d1cc8966fe530'
|
11
|
-
|
12
|
-
# ==> Mailer Configuration
|
13
|
-
# Configure the e-mail address which will be shown in Devise::Mailer,
|
14
|
-
# note that it will be overwritten if you use your own mailer class
|
15
|
-
# with default "from" parameter.
|
16
|
-
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
17
|
-
|
18
|
-
# Configure the class responsible to send e-mails.
|
19
|
-
# config.mailer = 'Devise::Mailer'
|
20
|
-
|
21
|
-
# ==> ORM configuration
|
22
|
-
# Load and configure the ORM. Supports :active_record (default) and
|
23
|
-
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
24
|
-
# available as additional gems.
|
25
|
-
require 'devise/orm/active_record'
|
26
|
-
|
27
|
-
# ==> Configuration for any authentication mechanism
|
28
|
-
# Configure which keys are used when authenticating a user. The default is
|
29
|
-
# just :email. You can configure it to use [:username, :subdomain], so for
|
30
|
-
# authenticating a user, both parameters are required. Remember that those
|
31
|
-
# parameters are used only when authenticating and not when retrieving from
|
32
|
-
# session. If you need permissions, you should implement that in a before filter.
|
33
|
-
# You can also supply a hash where the value is a boolean determining whether
|
34
|
-
# or not authentication should be aborted when the value is not present.
|
35
|
-
# config.authentication_keys = [:email]
|
36
|
-
|
37
|
-
# Configure parameters from the request object used for authentication. Each entry
|
38
|
-
# given should be a request method and it will automatically be passed to the
|
39
|
-
# find_for_authentication method and considered in your model lookup. For instance,
|
40
|
-
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
41
|
-
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
42
|
-
# config.request_keys = []
|
43
|
-
|
44
|
-
# Configure which authentication keys should be case-insensitive.
|
45
|
-
# These keys will be downcased upon creating or modifying a user and when used
|
46
|
-
# to authenticate or find a user. Default is :email.
|
47
|
-
config.case_insensitive_keys = [:email]
|
48
|
-
|
49
|
-
# Configure which authentication keys should have whitespace stripped.
|
50
|
-
# These keys will have whitespace before and after removed upon creating or
|
51
|
-
# modifying a user and when used to authenticate or find a user. Default is :email.
|
52
|
-
config.strip_whitespace_keys = [:email]
|
53
|
-
|
54
|
-
# Tell if authentication through request.params is enabled. True by default.
|
55
|
-
# It can be set to an array that will enable params authentication only for the
|
56
|
-
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
57
|
-
# enable it only for database (email + password) authentication.
|
58
|
-
# config.params_authenticatable = true
|
59
|
-
|
60
|
-
# Tell if authentication through HTTP Auth is enabled. False by default.
|
61
|
-
# It can be set to an array that will enable http authentication only for the
|
62
|
-
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
63
|
-
# enable it only for database authentication. The supported strategies are:
|
64
|
-
# :database = Support basic authentication with authentication key + password
|
65
|
-
# config.http_authenticatable = false
|
66
|
-
|
67
|
-
# If 401 status code should be returned for AJAX requests. True by default.
|
68
|
-
# config.http_authenticatable_on_xhr = true
|
69
|
-
|
70
|
-
# The realm used in Http Basic Authentication. 'Application' by default.
|
71
|
-
# config.http_authentication_realm = 'Application'
|
72
|
-
|
73
|
-
# It will change confirmation, password recovery and other workflows
|
74
|
-
# to behave the same regardless if the e-mail provided was right or wrong.
|
75
|
-
# Does not affect registerable.
|
76
|
-
# config.paranoid = true
|
77
|
-
|
78
|
-
# By default Devise will store the user in session. You can skip storage for
|
79
|
-
# particular strategies by setting this option.
|
80
|
-
# Notice that if you are skipping storage for all authentication paths, you
|
81
|
-
# may want to disable generating routes to Devise's sessions controller by
|
82
|
-
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
83
|
-
config.skip_session_storage = [:http_auth]
|
84
|
-
|
85
|
-
# By default, Devise cleans up the CSRF token on authentication to
|
86
|
-
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
87
|
-
# requests for sign in and sign up, you need to get a new CSRF token
|
88
|
-
# from the server. You can disable this option at your own risk.
|
89
|
-
# config.clean_up_csrf_token_on_authentication = true
|
90
|
-
|
91
|
-
# ==> Configuration for :database_authenticatable
|
92
|
-
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
93
|
-
# using other encryptors, it sets how many times you want the password re-encrypted.
|
94
|
-
#
|
95
|
-
# Limiting the stretches to just one in testing will increase the performance of
|
96
|
-
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
97
|
-
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
98
|
-
# encryptor), the cost increases exponentially with the number of stretches (e.g.
|
99
|
-
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
100
|
-
config.stretches = Rails.env.test? ? 1 : 10
|
101
|
-
|
102
|
-
# Setup a pepper to generate the encrypted password.
|
103
|
-
# config.pepper = '7d483ef48a0c859652bd623cba800fd76a8a45662f246b2dd2602b02635dbdf935ce0384f1c3bf13fdbe23880eab9f5fdf87fa46f92a1f36098f6051313383fe'
|
104
|
-
|
105
|
-
# ==> Configuration for :confirmable
|
106
|
-
# A period that the user is allowed to access the website even without
|
107
|
-
# confirming their account. For instance, if set to 2.days, the user will be
|
108
|
-
# able to access the website for two days without confirming their account,
|
109
|
-
# access will be blocked just in the third day. Default is 0.days, meaning
|
110
|
-
# the user cannot access the website without confirming their account.
|
111
|
-
# config.allow_unconfirmed_access_for = 2.days
|
112
|
-
|
113
|
-
# A period that the user is allowed to confirm their account before their
|
114
|
-
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
115
|
-
# their account within 3 days after the mail was sent, but on the fourth day
|
116
|
-
# their account can't be confirmed with the token any more.
|
117
|
-
# Default is nil, meaning there is no restriction on how long a user can take
|
118
|
-
# before confirming their account.
|
119
|
-
# config.confirm_within = 3.days
|
120
|
-
|
121
|
-
# If true, requires any email changes to be confirmed (exactly the same way as
|
122
|
-
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
123
|
-
# db field (see migrations). Until confirmed, new email is stored in
|
124
|
-
# unconfirmed_email column, and copied to email column on successful confirmation.
|
125
|
-
config.reconfirmable = true
|
126
|
-
|
127
|
-
# Defines which key will be used when confirming an account
|
128
|
-
# config.confirmation_keys = [:email]
|
129
|
-
|
130
|
-
# ==> Configuration for :rememberable
|
131
|
-
# The time the user will be remembered without asking for credentials again.
|
132
|
-
# config.remember_for = 2.weeks
|
133
|
-
|
134
|
-
# Invalidates all the remember me tokens when the user signs out.
|
135
|
-
config.expire_all_remember_me_on_sign_out = true
|
136
|
-
|
137
|
-
# If true, extends the user's remember period when remembered via cookie.
|
138
|
-
# config.extend_remember_period = false
|
139
|
-
|
140
|
-
# Options to be passed to the created cookie. For instance, you can set
|
141
|
-
# secure: true in order to force SSL only cookies.
|
142
|
-
# config.rememberable_options = {}
|
143
|
-
|
144
|
-
# ==> Configuration for :validatable
|
145
|
-
# Range for password length.
|
146
|
-
config.password_length = 8..72
|
147
|
-
|
148
|
-
# Email regex used to validate email formats. It simply asserts that
|
149
|
-
# one (and only one) @ exists in the given string. This is mainly
|
150
|
-
# to give user feedback and not to assert the e-mail validity.
|
151
|
-
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
152
|
-
|
153
|
-
# ==> Configuration for :timeoutable
|
154
|
-
# The time you want to timeout the user session without activity. After this
|
155
|
-
# time the user will be asked for credentials again. Default is 30 minutes.
|
156
|
-
# config.timeout_in = 30.minutes
|
157
|
-
|
158
|
-
# ==> Configuration for :lockable
|
159
|
-
# Defines which strategy will be used to lock an account.
|
160
|
-
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
161
|
-
# :none = No lock strategy. You should handle locking by yourself.
|
162
|
-
# config.lock_strategy = :failed_attempts
|
163
|
-
|
164
|
-
# Defines which key will be used when locking and unlocking an account
|
165
|
-
# config.unlock_keys = [:email]
|
166
|
-
|
167
|
-
# Defines which strategy will be used to unlock an account.
|
168
|
-
# :email = Sends an unlock link to the user email
|
169
|
-
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
170
|
-
# :both = Enables both strategies
|
171
|
-
# :none = No unlock strategy. You should handle unlocking by yourself.
|
172
|
-
# config.unlock_strategy = :both
|
173
|
-
|
174
|
-
# Number of authentication tries before locking an account if lock_strategy
|
175
|
-
# is failed attempts.
|
176
|
-
# config.maximum_attempts = 20
|
177
|
-
|
178
|
-
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
179
|
-
# config.unlock_in = 1.hour
|
180
|
-
|
181
|
-
# Warn on the last attempt before the account is locked.
|
182
|
-
# config.last_attempt_warning = true
|
183
|
-
|
184
|
-
# ==> Configuration for :recoverable
|
185
|
-
#
|
186
|
-
# Defines which key will be used when recovering the password for an account
|
187
|
-
# config.reset_password_keys = [:email]
|
188
|
-
|
189
|
-
# Time interval you can reset your password with a reset password key.
|
190
|
-
# Don't put a too small interval or your users won't have the time to
|
191
|
-
# change their passwords.
|
192
|
-
config.reset_password_within = 6.hours
|
193
|
-
|
194
|
-
# When set to false, does not sign a user in automatically after their password is
|
195
|
-
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
196
|
-
# config.sign_in_after_reset_password = true
|
197
|
-
|
198
|
-
# ==> Configuration for :encryptable
|
199
|
-
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
200
|
-
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
201
|
-
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
202
|
-
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
203
|
-
# REST_AUTH_SITE_KEY to pepper).
|
204
|
-
#
|
205
|
-
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
206
|
-
# config.encryptor = :sha512
|
207
|
-
|
208
|
-
# ==> Scopes configuration
|
209
|
-
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
210
|
-
# "users/sessions/new". It's turned off by default because it's slower if you
|
211
|
-
# are using only default views.
|
212
|
-
# config.scoped_views = false
|
213
|
-
|
214
|
-
# Configure the default scope given to Warden. By default it's the first
|
215
|
-
# devise role declared in your routes (usually :user).
|
216
|
-
# config.default_scope = :user
|
217
|
-
|
218
|
-
# Set this configuration to false if you want /users/sign_out to sign out
|
219
|
-
# only the current scope. By default, Devise signs out all scopes.
|
220
|
-
# config.sign_out_all_scopes = true
|
221
|
-
|
222
|
-
# ==> Navigation configuration
|
223
|
-
# Lists the formats that should be treated as navigational. Formats like
|
224
|
-
# :html, should redirect to the sign in page when the user does not have
|
225
|
-
# access, but formats like :xml or :json, should return 401.
|
226
|
-
#
|
227
|
-
# If you have any extra navigational formats, like :iphone or :mobile, you
|
228
|
-
# should add them to the navigational formats lists.
|
229
|
-
#
|
230
|
-
# The "*/*" below is required to match Internet Explorer requests.
|
231
|
-
# config.navigational_formats = ['*/*', :html]
|
232
|
-
|
233
|
-
# The default HTTP method used to sign out a resource. Default is :delete.
|
234
|
-
config.sign_out_via = :delete
|
235
|
-
|
236
|
-
# ==> OmniAuth
|
237
|
-
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
238
|
-
# up on your models and hooks.
|
239
|
-
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
240
|
-
|
241
|
-
# ==> Warden configuration
|
242
|
-
# If you want to use other strategies, that are not supported by Devise, or
|
243
|
-
# change the failure app, you can configure them inside the config.warden block.
|
244
|
-
#
|
245
|
-
# config.warden do |manager|
|
246
|
-
# manager.intercept_401 = false
|
247
|
-
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
248
|
-
# end
|
249
|
-
|
250
|
-
# ==> Mountable engine configurations
|
251
|
-
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
252
|
-
# is mountable, there are some extra configurations to be taken into account.
|
253
|
-
# The following options are available, assuming the engine is mounted as:
|
254
|
-
#
|
255
|
-
# mount MyEngine, at: '/my_engine'
|
256
|
-
#
|
257
|
-
# The router that invoked `devise_for`, in the example above, would be:
|
258
|
-
# config.router_name = :my_engine
|
259
|
-
#
|
260
|
-
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
261
|
-
# so you need to do it manually. For the users scope, it would be:
|
262
|
-
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
263
|
-
end
|
1
|
+
require 'devise'
|
2
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
3
|
+
# Many of these configuration options can be set straight in your model.
|
4
|
+
Devise.setup do |config|
|
5
|
+
# The secret key used by Devise. Devise uses this key to generate
|
6
|
+
# random tokens. Changing this key will render invalid all existing
|
7
|
+
# confirmation, reset password and unlock tokens in the database.
|
8
|
+
# Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
|
9
|
+
# by default. You can change it below and use your own secret key.
|
10
|
+
config.secret_key = '16f3eba693fcd1a875d60e96961501c7e78eb7167a68bdff3bb0fa14b66f985f0e07cccbb2c38ca105b71a4ab051adf35d5f7b368172e02a138d1cc8966fe530'
|
11
|
+
|
12
|
+
# ==> Mailer Configuration
|
13
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
14
|
+
# note that it will be overwritten if you use your own mailer class
|
15
|
+
# with default "from" parameter.
|
16
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
17
|
+
|
18
|
+
# Configure the class responsible to send e-mails.
|
19
|
+
# config.mailer = 'Devise::Mailer'
|
20
|
+
|
21
|
+
# ==> ORM configuration
|
22
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
23
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
24
|
+
# available as additional gems.
|
25
|
+
require 'devise/orm/active_record'
|
26
|
+
|
27
|
+
# ==> Configuration for any authentication mechanism
|
28
|
+
# Configure which keys are used when authenticating a user. The default is
|
29
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
30
|
+
# authenticating a user, both parameters are required. Remember that those
|
31
|
+
# parameters are used only when authenticating and not when retrieving from
|
32
|
+
# session. If you need permissions, you should implement that in a before filter.
|
33
|
+
# You can also supply a hash where the value is a boolean determining whether
|
34
|
+
# or not authentication should be aborted when the value is not present.
|
35
|
+
# config.authentication_keys = [:email]
|
36
|
+
|
37
|
+
# Configure parameters from the request object used for authentication. Each entry
|
38
|
+
# given should be a request method and it will automatically be passed to the
|
39
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
40
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
41
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
42
|
+
# config.request_keys = []
|
43
|
+
|
44
|
+
# Configure which authentication keys should be case-insensitive.
|
45
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
46
|
+
# to authenticate or find a user. Default is :email.
|
47
|
+
config.case_insensitive_keys = [:email]
|
48
|
+
|
49
|
+
# Configure which authentication keys should have whitespace stripped.
|
50
|
+
# These keys will have whitespace before and after removed upon creating or
|
51
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
52
|
+
config.strip_whitespace_keys = [:email]
|
53
|
+
|
54
|
+
# Tell if authentication through request.params is enabled. True by default.
|
55
|
+
# It can be set to an array that will enable params authentication only for the
|
56
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
57
|
+
# enable it only for database (email + password) authentication.
|
58
|
+
# config.params_authenticatable = true
|
59
|
+
|
60
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
61
|
+
# It can be set to an array that will enable http authentication only for the
|
62
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
63
|
+
# enable it only for database authentication. The supported strategies are:
|
64
|
+
# :database = Support basic authentication with authentication key + password
|
65
|
+
# config.http_authenticatable = false
|
66
|
+
|
67
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
68
|
+
# config.http_authenticatable_on_xhr = true
|
69
|
+
|
70
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
71
|
+
# config.http_authentication_realm = 'Application'
|
72
|
+
|
73
|
+
# It will change confirmation, password recovery and other workflows
|
74
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
75
|
+
# Does not affect registerable.
|
76
|
+
# config.paranoid = true
|
77
|
+
|
78
|
+
# By default Devise will store the user in session. You can skip storage for
|
79
|
+
# particular strategies by setting this option.
|
80
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
81
|
+
# may want to disable generating routes to Devise's sessions controller by
|
82
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
83
|
+
config.skip_session_storage = [:http_auth]
|
84
|
+
|
85
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
86
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
87
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
88
|
+
# from the server. You can disable this option at your own risk.
|
89
|
+
# config.clean_up_csrf_token_on_authentication = true
|
90
|
+
|
91
|
+
# ==> Configuration for :database_authenticatable
|
92
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
93
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
94
|
+
#
|
95
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
96
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
97
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
98
|
+
# encryptor), the cost increases exponentially with the number of stretches (e.g.
|
99
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
100
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
101
|
+
|
102
|
+
# Setup a pepper to generate the encrypted password.
|
103
|
+
# config.pepper = '7d483ef48a0c859652bd623cba800fd76a8a45662f246b2dd2602b02635dbdf935ce0384f1c3bf13fdbe23880eab9f5fdf87fa46f92a1f36098f6051313383fe'
|
104
|
+
|
105
|
+
# ==> Configuration for :confirmable
|
106
|
+
# A period that the user is allowed to access the website even without
|
107
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
108
|
+
# able to access the website for two days without confirming their account,
|
109
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
110
|
+
# the user cannot access the website without confirming their account.
|
111
|
+
# config.allow_unconfirmed_access_for = 2.days
|
112
|
+
|
113
|
+
# A period that the user is allowed to confirm their account before their
|
114
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
115
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
116
|
+
# their account can't be confirmed with the token any more.
|
117
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
118
|
+
# before confirming their account.
|
119
|
+
# config.confirm_within = 3.days
|
120
|
+
|
121
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
122
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
123
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
124
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
125
|
+
config.reconfirmable = true
|
126
|
+
|
127
|
+
# Defines which key will be used when confirming an account
|
128
|
+
# config.confirmation_keys = [:email]
|
129
|
+
|
130
|
+
# ==> Configuration for :rememberable
|
131
|
+
# The time the user will be remembered without asking for credentials again.
|
132
|
+
# config.remember_for = 2.weeks
|
133
|
+
|
134
|
+
# Invalidates all the remember me tokens when the user signs out.
|
135
|
+
config.expire_all_remember_me_on_sign_out = true
|
136
|
+
|
137
|
+
# If true, extends the user's remember period when remembered via cookie.
|
138
|
+
# config.extend_remember_period = false
|
139
|
+
|
140
|
+
# Options to be passed to the created cookie. For instance, you can set
|
141
|
+
# secure: true in order to force SSL only cookies.
|
142
|
+
# config.rememberable_options = {}
|
143
|
+
|
144
|
+
# ==> Configuration for :validatable
|
145
|
+
# Range for password length.
|
146
|
+
config.password_length = 8..72
|
147
|
+
|
148
|
+
# Email regex used to validate email formats. It simply asserts that
|
149
|
+
# one (and only one) @ exists in the given string. This is mainly
|
150
|
+
# to give user feedback and not to assert the e-mail validity.
|
151
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
152
|
+
|
153
|
+
# ==> Configuration for :timeoutable
|
154
|
+
# The time you want to timeout the user session without activity. After this
|
155
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
156
|
+
# config.timeout_in = 30.minutes
|
157
|
+
|
158
|
+
# ==> Configuration for :lockable
|
159
|
+
# Defines which strategy will be used to lock an account.
|
160
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
161
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
162
|
+
# config.lock_strategy = :failed_attempts
|
163
|
+
|
164
|
+
# Defines which key will be used when locking and unlocking an account
|
165
|
+
# config.unlock_keys = [:email]
|
166
|
+
|
167
|
+
# Defines which strategy will be used to unlock an account.
|
168
|
+
# :email = Sends an unlock link to the user email
|
169
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
170
|
+
# :both = Enables both strategies
|
171
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
172
|
+
# config.unlock_strategy = :both
|
173
|
+
|
174
|
+
# Number of authentication tries before locking an account if lock_strategy
|
175
|
+
# is failed attempts.
|
176
|
+
# config.maximum_attempts = 20
|
177
|
+
|
178
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
179
|
+
# config.unlock_in = 1.hour
|
180
|
+
|
181
|
+
# Warn on the last attempt before the account is locked.
|
182
|
+
# config.last_attempt_warning = true
|
183
|
+
|
184
|
+
# ==> Configuration for :recoverable
|
185
|
+
#
|
186
|
+
# Defines which key will be used when recovering the password for an account
|
187
|
+
# config.reset_password_keys = [:email]
|
188
|
+
|
189
|
+
# Time interval you can reset your password with a reset password key.
|
190
|
+
# Don't put a too small interval or your users won't have the time to
|
191
|
+
# change their passwords.
|
192
|
+
config.reset_password_within = 6.hours
|
193
|
+
|
194
|
+
# When set to false, does not sign a user in automatically after their password is
|
195
|
+
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
196
|
+
# config.sign_in_after_reset_password = true
|
197
|
+
|
198
|
+
# ==> Configuration for :encryptable
|
199
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
200
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
201
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
202
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
203
|
+
# REST_AUTH_SITE_KEY to pepper).
|
204
|
+
#
|
205
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
206
|
+
# config.encryptor = :sha512
|
207
|
+
|
208
|
+
# ==> Scopes configuration
|
209
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
210
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
211
|
+
# are using only default views.
|
212
|
+
# config.scoped_views = false
|
213
|
+
|
214
|
+
# Configure the default scope given to Warden. By default it's the first
|
215
|
+
# devise role declared in your routes (usually :user).
|
216
|
+
# config.default_scope = :user
|
217
|
+
|
218
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
219
|
+
# only the current scope. By default, Devise signs out all scopes.
|
220
|
+
# config.sign_out_all_scopes = true
|
221
|
+
|
222
|
+
# ==> Navigation configuration
|
223
|
+
# Lists the formats that should be treated as navigational. Formats like
|
224
|
+
# :html, should redirect to the sign in page when the user does not have
|
225
|
+
# access, but formats like :xml or :json, should return 401.
|
226
|
+
#
|
227
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
228
|
+
# should add them to the navigational formats lists.
|
229
|
+
#
|
230
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
231
|
+
# config.navigational_formats = ['*/*', :html]
|
232
|
+
|
233
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
234
|
+
config.sign_out_via = :delete
|
235
|
+
|
236
|
+
# ==> OmniAuth
|
237
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
238
|
+
# up on your models and hooks.
|
239
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
240
|
+
|
241
|
+
# ==> Warden configuration
|
242
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
243
|
+
# change the failure app, you can configure them inside the config.warden block.
|
244
|
+
#
|
245
|
+
# config.warden do |manager|
|
246
|
+
# manager.intercept_401 = false
|
247
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
248
|
+
# end
|
249
|
+
|
250
|
+
# ==> Mountable engine configurations
|
251
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
252
|
+
# is mountable, there are some extra configurations to be taken into account.
|
253
|
+
# The following options are available, assuming the engine is mounted as:
|
254
|
+
#
|
255
|
+
# mount MyEngine, at: '/my_engine'
|
256
|
+
#
|
257
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
258
|
+
# config.router_name = :my_engine
|
259
|
+
#
|
260
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
261
|
+
# so you need to do it manually. For the users scope, it would be:
|
262
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
263
|
+
end
|
@@ -1,4 +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]
|
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]
|
@@ -1,16 +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
|
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
|
@@ -1,4 +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
|
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
|
@@ -1,3 +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'
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Rails.application.config.session_store :cookie_store, key: '_dummy_session'
|
@@ -1,14 +1,14 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
-
# is enabled by default.
|
5
|
-
|
6
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
-
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
-
end
|
10
|
-
|
11
|
-
# To enable root element in JSON for ActiveRecord objects.
|
12
|
-
# ActiveSupport.on_load(:active_record) do
|
13
|
-
# self.include_root_in_json = true
|
14
|
-
# end
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|