raygun 0.0.11 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -3
- data/.rbenv-version +1 -1
- data/README.md +2 -9
- data/Rakefile +1 -1
- data/TODO.md +0 -5
- data/app_prototype/.gitignore +15 -0
- data/app_prototype/.rspec +1 -0
- data/app_prototype/.rvmrc +1 -0
- data/{templates/Gemfile_customized → app_prototype/Gemfile} +1 -0
- data/{templates/Guardfile_customized → app_prototype/Guardfile} +6 -0
- data/{templates → app_prototype}/Procfile +0 -0
- data/{templates/README.md.erb → app_prototype/README.md} +0 -0
- data/app_prototype/Rakefile +10 -0
- data/app_prototype/app/assets/javascripts/application.js +16 -0
- data/app_prototype/app/assets/javascripts/users.js.coffee +3 -0
- data/{templates/_app → app_prototype/app}/assets/stylesheets/_footer.less +0 -0
- data/{templates/_app → app_prototype/app}/assets/stylesheets/application.css.less +0 -0
- data/{templates/_app → app_prototype/app}/controllers/application_controller.rb +1 -0
- data/{templates/_app → app_prototype/app}/controllers/password_resets_controller.rb +0 -0
- data/{templates/_app → app_prototype/app}/controllers/registrations_controller.rb +2 -0
- data/{templates/_app → app_prototype/app}/controllers/user_sessions_controller.rb +1 -1
- data/app_prototype/app/controllers/users_controller.rb +41 -0
- data/{templates/_app → app_prototype/app}/helpers/application_helper.rb +0 -0
- data/app_prototype/app/helpers/users_helper.rb +2 -0
- data/app_prototype/app/mailers/.gitkeep +0 -0
- data/{templates/_app → app_prototype/app}/mailers/user_mailer.rb +0 -0
- data/app_prototype/app/models/.gitkeep +0 -0
- data/{templates/_app → app_prototype/app}/models/ability.rb +0 -0
- data/{templates/_app → app_prototype/app}/models/user.rb +0 -0
- data/{templates/_app → app_prototype/app}/models/user_session.rb +0 -0
- data/{templates/_app/views/layouts/application.html.slim.erb → app_prototype/app/views/layouts/application.html.slim} +2 -2
- data/{templates/_app → app_prototype/app}/views/password_resets/edit.html.slim +0 -0
- data/{templates/_app → app_prototype/app}/views/password_resets/new.html.slim +0 -0
- data/{templates/_app → app_prototype/app}/views/registrations/new.html.slim +0 -0
- data/{templates/_app → app_prototype/app}/views/user_mailer/activation_needed_email.html.erb +0 -0
- data/{templates/_app → app_prototype/app}/views/user_mailer/activation_needed_email.text.erb +0 -0
- data/{templates/_app → app_prototype/app}/views/user_mailer/activation_success_email.html.erb +0 -0
- data/{templates/_app → app_prototype/app}/views/user_mailer/activation_success_email.text.erb +0 -0
- data/{templates/_app → app_prototype/app}/views/user_mailer/reset_password_email.html.erb +0 -0
- data/{templates/_app → app_prototype/app}/views/user_mailer/reset_password_email.text.erb +0 -0
- data/{templates/_app → app_prototype/app}/views/user_sessions/new.html.slim +0 -0
- data/app_prototype/app/views/users/_form.html.slim +12 -0
- data/app_prototype/app/views/users/edit.html.slim +5 -0
- data/app_prototype/app/views/users/index.html.slim +26 -0
- data/app_prototype/app/views/users/new.html.slim +4 -0
- data/app_prototype/app/views/users/show.html.slim +17 -0
- data/app_prototype/config.ru +8 -0
- data/app_prototype/config/application.rb +77 -0
- data/app_prototype/config/boot.rb +6 -0
- data/{templates/_config/database.yml.erb → app_prototype/config/database.yml} +2 -2
- data/app_prototype/config/environment.rb +5 -0
- data/app_prototype/config/environments/acceptance.rb +69 -0
- data/app_prototype/config/environments/development.rb +39 -0
- data/app_prototype/config/environments/production.rb +69 -0
- data/app_prototype/config/environments/test.rb +40 -0
- data/app_prototype/config/initializers/backtrace_silencers.rb +7 -0
- data/app_prototype/config/initializers/inflections.rb +15 -0
- data/app_prototype/config/initializers/mime_types.rb +5 -0
- data/app_prototype/config/initializers/secret_token.rb +7 -0
- data/app_prototype/config/initializers/session_store.rb +8 -0
- data/app_prototype/config/initializers/simple_form.rb +142 -0
- data/app_prototype/config/initializers/simple_form_bootstrap.rb +45 -0
- data/app_prototype/config/initializers/sorcery.rb +398 -0
- data/app_prototype/config/initializers/wrap_parameters.rb +14 -0
- data/app_prototype/config/locales/en.yml +5 -0
- data/app_prototype/config/locales/simple_form.en.yml +26 -0
- data/app_prototype/config/routes.rb +21 -0
- data/app_prototype/db/migrate/20121128215324_sorcery_core.rb +17 -0
- data/app_prototype/db/migrate/20121128215325_sorcery_brute_force_protection.rb +13 -0
- data/app_prototype/db/migrate/20121128215326_sorcery_activity_logging.rb +17 -0
- data/app_prototype/db/migrate/20121128215327_sorcery_user_activation.rb +17 -0
- data/app_prototype/db/migrate/20121128215328_sorcery_remember_me.rb +15 -0
- data/app_prototype/db/migrate/20121128215329_sorcery_reset_password.rb +17 -0
- data/app_prototype/db/migrate/20121128215330_sorcery_external.rb +14 -0
- data/app_prototype/db/migrate/20121128215337_add_admin_to_users.rb +5 -0
- data/{templates/_db → app_prototype/db}/sample_data.rb +0 -0
- data/app_prototype/db/schema.rb +53 -0
- data/app_prototype/db/seeds.rb +7 -0
- data/app_prototype/lib/assets/.gitkeep +0 -0
- data/app_prototype/lib/tasks/.gitkeep +0 -0
- data/{templates/_lib → app_prototype/lib}/tasks/coverage.rake +0 -0
- data/{templates/_lib → app_prototype/lib}/tasks/db.rake +0 -0
- data/{templates/_lib → app_prototype/lib}/tasks/spec.rake +0 -0
- data/{templates/_lib → app_prototype/lib}/templates/rails/scaffold_controller/controller.rb +0 -0
- data/{templates/_lib → app_prototype/lib}/templates/rspec/scaffold/controller_spec.rb +1 -1
- data/{templates/_lib → app_prototype/lib}/templates/slim/scaffold/_form.html.slim +0 -0
- data/{templates/_lib → app_prototype/lib}/templates/slim/scaffold/edit.html.slim +0 -0
- data/{templates/_lib → app_prototype/lib}/templates/slim/scaffold/index.html.slim +0 -0
- data/{templates/_lib → app_prototype/lib}/templates/slim/scaffold/new.html.slim +0 -0
- data/{templates/_lib → app_prototype/lib}/templates/slim/scaffold/show.html.slim +0 -0
- data/app_prototype/log/.gitkeep +0 -0
- data/app_prototype/public/404.html +26 -0
- data/app_prototype/public/422.html +26 -0
- data/app_prototype/public/500.html +25 -0
- data/app_prototype/public/favicon.ico +0 -0
- data/{templates/_public/index.html.erb → app_prototype/public/index.html} +2 -2
- data/app_prototype/public/robots.txt +5 -0
- data/app_prototype/script/rails +6 -0
- data/app_prototype/spec/controllers/user_sessions_controller_spec.rb +42 -0
- data/app_prototype/spec/controllers/users_controller_spec.rb +150 -0
- data/{templates/_spec → app_prototype/spec}/factories/users.rb +0 -0
- data/{templates/_spec → app_prototype/spec}/features/user_sessions_spec.rb +5 -1
- data/app_prototype/spec/helpers/users_helper_spec.rb +15 -0
- data/{templates/_spec → app_prototype/spec}/javascripts/example_spec.js.coffee +0 -0
- data/{templates/_spec → app_prototype/spec}/javascripts/spec.css +0 -0
- data/{templates/_spec → app_prototype/spec}/javascripts/spec.js.coffee +0 -0
- data/{templates/_spec → app_prototype/spec}/mailers/user_mailer_spec.rb +0 -0
- data/{templates/_spec → app_prototype/spec}/models/ability_spec.rb +0 -0
- data/{templates/_spec → app_prototype/spec}/models/user_spec.rb +0 -0
- data/app_prototype/spec/spec_helper.rb +84 -0
- data/{templates/_spec → app_prototype/spec}/support/accept_values.rb +0 -0
- data/{templates/_spec → app_prototype/spec}/support/factory_girl.rb +0 -0
- data/{templates/_spec → app_prototype/spec}/support/sorcery.rb +0 -0
- data/{templates/_spec → app_prototype/spec}/support/user_sessions_feature_helper.rb +0 -0
- data/app_prototype/spec/views/users/edit.html.slim_spec.rb +20 -0
- data/app_prototype/spec/views/users/index.html.slim_spec.rb +23 -0
- data/app_prototype/spec/views/users/new.html.slim_spec.rb +20 -0
- data/app_prototype/spec/views/users/show.html.slim_spec.rb +17 -0
- data/app_prototype/vendor/assets/javascripts/.gitkeep +0 -0
- data/app_prototype/vendor/assets/stylesheets/.gitkeep +0 -0
- data/app_prototype/vendor/plugins/.gitkeep +0 -0
- data/bin/raygun +48 -6
- data/lib/raygun/version.rb +1 -1
- data/raygun.gemspec +0 -3
- metadata +118 -108
- data/lib/raygun/actions.rb +0 -26
- data/lib/raygun/app_builder.rb +0 -362
- data/lib/raygun/generators/app_generator.rb +0 -188
- data/lib/raygun/helpers/ruby_version_helpers.rb +0 -52
- data/lib/raygun/raygun.rb +0 -11
- data/templates/rbenv-version.erb +0 -1
- data/templates/rvmrc.erb +0 -1
@@ -0,0 +1,398 @@
|
|
1
|
+
# The first thing you need to configure is which modules you need in your app.
|
2
|
+
# The default is nothing which will include only core features (password encryption, login/logout).
|
3
|
+
# Available submodules are: :user_activation, :http_basic_auth, :remember_me,
|
4
|
+
# :reset_password, :session_timeout, :brute_force_protection, :activity_logging, :external
|
5
|
+
Rails.application.config.sorcery.submodules = [:brute_force_protection, :activity_logging, :user_activation, :remember_me, :reset_password, :external]
|
6
|
+
|
7
|
+
# Here you can configure each submodule's features.
|
8
|
+
Rails.application.config.sorcery.configure do |config|
|
9
|
+
# -- core --
|
10
|
+
# What controller action to call for non-authenticated users. You can also
|
11
|
+
# override the 'not_authenticated' method of course.
|
12
|
+
# Default: `:not_authenticated`
|
13
|
+
#
|
14
|
+
# config.not_authenticated_action =
|
15
|
+
|
16
|
+
|
17
|
+
# When a non logged in user tries to enter a page that requires login, save
|
18
|
+
# the URL he wanted to reach, and send him there after login, using 'redirect_back_or_to'.
|
19
|
+
# Default: `true`
|
20
|
+
#
|
21
|
+
# config.save_return_to_url =
|
22
|
+
|
23
|
+
|
24
|
+
# Set domain option for cookies; Useful for remember_me submodule.
|
25
|
+
# Default: `nil`
|
26
|
+
#
|
27
|
+
# config.cookie_domain =
|
28
|
+
|
29
|
+
|
30
|
+
# -- session timeout --
|
31
|
+
# How long in seconds to keep the session alive.
|
32
|
+
# Default: `3600`
|
33
|
+
#
|
34
|
+
# config.session_timeout =
|
35
|
+
|
36
|
+
|
37
|
+
# Use the last action as the beginning of session timeout.
|
38
|
+
# Default: `false`
|
39
|
+
#
|
40
|
+
# config.session_timeout_from_last_action =
|
41
|
+
|
42
|
+
|
43
|
+
# -- http_basic_auth --
|
44
|
+
# What realm to display for which controller name. For example {"My App" => "Application"}
|
45
|
+
# Default: `{"application" => "Application"}`
|
46
|
+
#
|
47
|
+
# config.controller_to_realm_map =
|
48
|
+
|
49
|
+
|
50
|
+
# -- activity logging --
|
51
|
+
# will register the time of last user login, every login.
|
52
|
+
# Default: `true`
|
53
|
+
#
|
54
|
+
# config.register_login_time =
|
55
|
+
|
56
|
+
|
57
|
+
# will register the time of last user logout, every logout.
|
58
|
+
# Default: `true`
|
59
|
+
#
|
60
|
+
# config.register_logout_time =
|
61
|
+
|
62
|
+
|
63
|
+
# will register the time of last user action, every action.
|
64
|
+
# Default: `true`
|
65
|
+
#
|
66
|
+
# config.register_last_activity_time =
|
67
|
+
|
68
|
+
|
69
|
+
# -- external --
|
70
|
+
# What providers are supported by this app, i.e. [:twitter, :facebook, :github, :google, :liveid] .
|
71
|
+
# Default: `[]`
|
72
|
+
#
|
73
|
+
# config.external_providers =
|
74
|
+
|
75
|
+
|
76
|
+
# You can change it by your local ca_file. i.e. '/etc/pki/tls/certs/ca-bundle.crt'
|
77
|
+
# Path to ca_file. By default use a internal ca-bundle.crt.
|
78
|
+
# Default: `'path/to/ca_file'`
|
79
|
+
#
|
80
|
+
# config.ca_file =
|
81
|
+
|
82
|
+
|
83
|
+
# Twitter wil not accept any requests nor redirect uri containing localhost,
|
84
|
+
# make sure you use 0.0.0.0:3000 to access your app in development
|
85
|
+
#
|
86
|
+
# config.twitter.key = ""
|
87
|
+
# config.twitter.secret = ""
|
88
|
+
# config.twitter.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=twitter"
|
89
|
+
# config.twitter.user_info_mapping = {:email => "screen_name"}
|
90
|
+
#
|
91
|
+
# config.facebook.key = ""
|
92
|
+
# config.facebook.secret = ""
|
93
|
+
# config.facebook.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=facebook"
|
94
|
+
# config.facebook.user_info_mapping = {:email => "name"}
|
95
|
+
#
|
96
|
+
# config.github.key = ""
|
97
|
+
# config.github.secret = ""
|
98
|
+
# config.github.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=github"
|
99
|
+
# config.github.user_info_mapping = {:email => "name"}
|
100
|
+
#
|
101
|
+
# config.google.key = ""
|
102
|
+
# config.google.secret = ""
|
103
|
+
# config.google.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=google"
|
104
|
+
# config.google.user_info_mapping = {:email => "email", :username => "name"}
|
105
|
+
#
|
106
|
+
# To use liveid in development mode you have to replace mydomain.com with
|
107
|
+
# a valid domain even in development. To use a valid domain in development
|
108
|
+
# simply add your domain in your /etc/hosts file in front of 127.0.0.1
|
109
|
+
#
|
110
|
+
# config.liveid.key = ""
|
111
|
+
# config.liveid.secret = ""
|
112
|
+
# config.liveid.callback_url = "http://mydomain.com:3000/oauth/callback?provider=liveid"
|
113
|
+
# config.liveid.user_info_mapping = {:username => "name"}
|
114
|
+
|
115
|
+
|
116
|
+
# --- user config ---
|
117
|
+
config.user_config do |user|
|
118
|
+
# -- core --
|
119
|
+
# specify username attributes, for example: [:username, :email].
|
120
|
+
# Default: `[:username]`
|
121
|
+
#
|
122
|
+
user.username_attribute_names = :email
|
123
|
+
|
124
|
+
|
125
|
+
# change *virtual* password attribute, the one which is used until an encrypted one is generated.
|
126
|
+
# Default: `:password`
|
127
|
+
#
|
128
|
+
# user.password_attribute_name =
|
129
|
+
|
130
|
+
|
131
|
+
# downcase the username before trying to authenticate, default is false
|
132
|
+
# Default: `false`
|
133
|
+
#
|
134
|
+
# user.downcase_username_before_authenticating =
|
135
|
+
|
136
|
+
|
137
|
+
# change default email attribute.
|
138
|
+
# Default: `:email`
|
139
|
+
#
|
140
|
+
# user.email_attribute_name =
|
141
|
+
|
142
|
+
|
143
|
+
# change default crypted_password attribute.
|
144
|
+
# Default: `:crypted_password`
|
145
|
+
#
|
146
|
+
# user.crypted_password_attribute_name =
|
147
|
+
|
148
|
+
|
149
|
+
# what pattern to use to join the password with the salt
|
150
|
+
# Default: `""`
|
151
|
+
#
|
152
|
+
# user.salt_join_token =
|
153
|
+
|
154
|
+
|
155
|
+
# change default salt attribute.
|
156
|
+
# Default: `:salt`
|
157
|
+
#
|
158
|
+
# user.salt_attribute_name =
|
159
|
+
|
160
|
+
|
161
|
+
# how many times to apply encryption to the password.
|
162
|
+
# Default: `nil`
|
163
|
+
#
|
164
|
+
# user.stretches =
|
165
|
+
|
166
|
+
|
167
|
+
# encryption key used to encrypt reversible encryptions such as AES256.
|
168
|
+
# WARNING: If used for users' passwords, changing this key will leave passwords undecryptable!
|
169
|
+
# Default: `nil`
|
170
|
+
#
|
171
|
+
# user.encryption_key =
|
172
|
+
|
173
|
+
|
174
|
+
# use an external encryption class.
|
175
|
+
# Default: `nil`
|
176
|
+
#
|
177
|
+
# user.custom_encryption_provider =
|
178
|
+
|
179
|
+
|
180
|
+
# encryption algorithm name. See 'encryption_algorithm=' for available options.
|
181
|
+
# Default: `:bcrypt`
|
182
|
+
#
|
183
|
+
# user.encryption_algorithm =
|
184
|
+
|
185
|
+
|
186
|
+
# make this configuration inheritable for subclasses. Useful for ActiveRecord's STI.
|
187
|
+
# Default: `false`
|
188
|
+
#
|
189
|
+
# user.subclasses_inherit_config =
|
190
|
+
|
191
|
+
|
192
|
+
# -- user_activation --
|
193
|
+
# the attribute name to hold activation state (active/pending).
|
194
|
+
# Default: `:activation_state`
|
195
|
+
#
|
196
|
+
# user.activation_state_attribute_name =
|
197
|
+
|
198
|
+
|
199
|
+
# the attribute name to hold activation code (sent by email).
|
200
|
+
# Default: `:activation_token`
|
201
|
+
#
|
202
|
+
# user.activation_token_attribute_name =
|
203
|
+
|
204
|
+
|
205
|
+
# the attribute name to hold activation code expiration date.
|
206
|
+
# Default: `:activation_token_expires_at`
|
207
|
+
#
|
208
|
+
# user.activation_token_expires_at_attribute_name =
|
209
|
+
|
210
|
+
|
211
|
+
# how many seconds before the activation code expires. nil for never expires.
|
212
|
+
# Default: `nil`
|
213
|
+
#
|
214
|
+
# user.activation_token_expiration_period =
|
215
|
+
|
216
|
+
|
217
|
+
# your mailer class. Required.
|
218
|
+
# Default: `nil`
|
219
|
+
#
|
220
|
+
user.user_activation_mailer = UserMailer
|
221
|
+
|
222
|
+
|
223
|
+
# when true sorcery will not automatically
|
224
|
+
# email activation details and allow you to
|
225
|
+
# manually handle how and when email is sent.
|
226
|
+
# Default: `false`
|
227
|
+
#
|
228
|
+
# user.activation_mailer_disabled =
|
229
|
+
|
230
|
+
|
231
|
+
# activation needed email method on your mailer class.
|
232
|
+
# Default: `:activation_needed_email`
|
233
|
+
#
|
234
|
+
# user.activation_needed_email_method_name =
|
235
|
+
|
236
|
+
|
237
|
+
# activation success email method on your mailer class.
|
238
|
+
# Default: `:activation_success_email`
|
239
|
+
#
|
240
|
+
# user.activation_success_email_method_name =
|
241
|
+
|
242
|
+
|
243
|
+
# do you want to prevent or allow users that did not activate by email to login?
|
244
|
+
# Default: `true`
|
245
|
+
#
|
246
|
+
# user.prevent_non_active_users_to_login =
|
247
|
+
|
248
|
+
|
249
|
+
# -- reset_password --
|
250
|
+
# reset password code attribute name.
|
251
|
+
# Default: `:reset_password_token`
|
252
|
+
#
|
253
|
+
# user.reset_password_token_attribute_name =
|
254
|
+
|
255
|
+
|
256
|
+
# expires at attribute name.
|
257
|
+
# Default: `:reset_password_token_expires_at`
|
258
|
+
#
|
259
|
+
# user.reset_password_token_expires_at_attribute_name =
|
260
|
+
|
261
|
+
|
262
|
+
# when was email sent, used for hammering protection.
|
263
|
+
# Default: `:reset_password_email_sent_at`
|
264
|
+
#
|
265
|
+
# user.reset_password_email_sent_at_attribute_name =
|
266
|
+
|
267
|
+
|
268
|
+
# mailer class. Needed.
|
269
|
+
# Default: `nil`
|
270
|
+
#
|
271
|
+
user.reset_password_mailer = UserMailer
|
272
|
+
|
273
|
+
|
274
|
+
# reset password email method on your mailer class.
|
275
|
+
# Default: `:reset_password_email`
|
276
|
+
#
|
277
|
+
# user.reset_password_email_method_name =
|
278
|
+
|
279
|
+
|
280
|
+
# when true sorcery will not automatically
|
281
|
+
# email password reset details and allow you to
|
282
|
+
# manually handle how and when email is sent
|
283
|
+
# Default: `false`
|
284
|
+
#
|
285
|
+
# user.reset_password_mailer_disabled =
|
286
|
+
|
287
|
+
|
288
|
+
# how many seconds before the reset request expires. nil for never expires.
|
289
|
+
# Default: `nil`
|
290
|
+
#
|
291
|
+
# user.reset_password_expiration_period =
|
292
|
+
|
293
|
+
|
294
|
+
# hammering protection, how long to wait before allowing another email to be sent.
|
295
|
+
# Default: `5 * 60`
|
296
|
+
#
|
297
|
+
# user.reset_password_time_between_emails =
|
298
|
+
|
299
|
+
|
300
|
+
# -- brute_force_protection --
|
301
|
+
# Failed logins attribute name.
|
302
|
+
# Default: `:failed_logins_count`
|
303
|
+
#
|
304
|
+
# user.failed_logins_count_attribute_name =
|
305
|
+
|
306
|
+
|
307
|
+
# This field indicates whether user is banned and when it will be active again.
|
308
|
+
# Default: `:lock_expires_at`
|
309
|
+
#
|
310
|
+
# user.lock_expires_at_attribute_name =
|
311
|
+
|
312
|
+
|
313
|
+
# How many failed logins allowed.
|
314
|
+
# Default: `50`
|
315
|
+
#
|
316
|
+
# user.consecutive_login_retries_amount_limit =
|
317
|
+
|
318
|
+
|
319
|
+
# How long the user should be banned. in seconds. 0 for permanent.
|
320
|
+
# Default: `60 * 60`
|
321
|
+
#
|
322
|
+
# user.login_lock_time_period =
|
323
|
+
|
324
|
+
# Unlock token attribute name
|
325
|
+
# Default: `:unlock_token`
|
326
|
+
#
|
327
|
+
# user.unlock_token_attribute_name =
|
328
|
+
|
329
|
+
# Unlock token mailer method
|
330
|
+
# Default: `:send_unlock_token_email`
|
331
|
+
#
|
332
|
+
# user.unlock_token_email_method_name =
|
333
|
+
|
334
|
+
# when true sorcery will not automatically
|
335
|
+
# send email with unlock token
|
336
|
+
# Default: `false`
|
337
|
+
#
|
338
|
+
# user.unlock_token_mailer_disabled = true
|
339
|
+
|
340
|
+
# Unlock token mailer class
|
341
|
+
# Default: `nil`
|
342
|
+
#
|
343
|
+
# user.unlock_token_mailer = UserMailer
|
344
|
+
|
345
|
+
# -- activity logging --
|
346
|
+
# Last login attribute name.
|
347
|
+
# Default: `:last_login_at`
|
348
|
+
#
|
349
|
+
# user.last_login_at_attribute_name =
|
350
|
+
|
351
|
+
|
352
|
+
# Last logout attribute name.
|
353
|
+
# Default: `:last_logout_at`
|
354
|
+
#
|
355
|
+
# user.last_logout_at_attribute_name =
|
356
|
+
|
357
|
+
|
358
|
+
# Last activity attribute name.
|
359
|
+
# Default: `:last_activity_at`
|
360
|
+
#
|
361
|
+
# user.last_activity_at_attribute_name =
|
362
|
+
|
363
|
+
|
364
|
+
# How long since last activity is he user defined logged out?
|
365
|
+
# Default: `10 * 60`
|
366
|
+
#
|
367
|
+
# user.activity_timeout =
|
368
|
+
|
369
|
+
|
370
|
+
# -- external --
|
371
|
+
# Class which holds the various external provider data for this user.
|
372
|
+
# Default: `nil`
|
373
|
+
#
|
374
|
+
# user.authentications_class =
|
375
|
+
|
376
|
+
|
377
|
+
# User's identifier in authentications class.
|
378
|
+
# Default: `:user_id`
|
379
|
+
#
|
380
|
+
# user.authentications_user_id_attribute_name =
|
381
|
+
|
382
|
+
|
383
|
+
# Provider's identifier in authentications class.
|
384
|
+
# Default: `:provider`
|
385
|
+
#
|
386
|
+
# user.provider_attribute_name =
|
387
|
+
|
388
|
+
|
389
|
+
# User's external unique identifier in authentications class.
|
390
|
+
# Default: `:uid`
|
391
|
+
#
|
392
|
+
# user.provider_uid_attribute_name =
|
393
|
+
end
|
394
|
+
|
395
|
+
# This line must come after the 'user config' block.
|
396
|
+
# Define which model authenticates with sorcery.
|
397
|
+
config.user_class = User
|
398
|
+
end
|
@@ -0,0 +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]
|
9
|
+
end
|
10
|
+
|
11
|
+
# Disable root element in JSON by default.
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
13
|
+
self.include_root_in_json = false
|
14
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
en:
|
2
|
+
simple_form:
|
3
|
+
"yes": 'Yes'
|
4
|
+
"no": 'No'
|
5
|
+
required:
|
6
|
+
text: 'required'
|
7
|
+
mark: '*'
|
8
|
+
# You can uncomment the line below if you need to overwrite the whole required html.
|
9
|
+
# When using html, text and mark won't be used.
|
10
|
+
# html: '<abbr title="required">*</abbr>'
|
11
|
+
error_notification:
|
12
|
+
default_message: "Please review the problems below:"
|
13
|
+
# Labels and hints examples
|
14
|
+
# labels:
|
15
|
+
# defaults:
|
16
|
+
# password: 'Password'
|
17
|
+
# user:
|
18
|
+
# new:
|
19
|
+
# email: 'E-mail to sign in.'
|
20
|
+
# edit:
|
21
|
+
# email: 'E-mail.'
|
22
|
+
# hints:
|
23
|
+
# defaults:
|
24
|
+
# username: 'User name to sign in.'
|
25
|
+
# password: 'No special characters, please.'
|
26
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
AppPrototype::Application.routes.draw do
|
2
|
+
match 'sign_in' => 'user_sessions#new', as: :sign_in
|
3
|
+
|
4
|
+
match 'sign_out' => 'user_sessions#destroy', as: :sign_out
|
5
|
+
|
6
|
+
resources :user_sessions, only: [:new, :create, :destroy]
|
7
|
+
|
8
|
+
resources :registrations, only: [:new, :create, :activate]
|
9
|
+
|
10
|
+
match 'sign_up' => 'registrations#new', via: :get
|
11
|
+
|
12
|
+
match 'sign_up' => 'registrations#create', via: :post
|
13
|
+
|
14
|
+
match 'sign_up/:token/activate' => 'registrations#activate', via: :get
|
15
|
+
|
16
|
+
resources :password_resets, only: [:new, :create, :edit, :update]
|
17
|
+
|
18
|
+
resources :users
|
19
|
+
|
20
|
+
|
21
|
+
end
|