ultra-max-kit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/devise-5.0.4/CHANGELOG.md +88 -0
- data/devise-5.0.4/MIT-LICENSE +21 -0
- data/devise-5.0.4/README.md +776 -0
- data/devise-5.0.4/app/controllers/devise/confirmations_controller.rb +54 -0
- data/devise-5.0.4/app/controllers/devise/omniauth_callbacks_controller.rb +36 -0
- data/devise-5.0.4/app/controllers/devise/passwords_controller.rb +88 -0
- data/devise-5.0.4/app/controllers/devise/registrations_controller.rb +169 -0
- data/devise-5.0.4/app/controllers/devise/sessions_controller.rb +83 -0
- data/devise-5.0.4/app/controllers/devise/unlocks_controller.rb +52 -0
- data/devise-5.0.4/app/controllers/devise_controller.rb +226 -0
- data/devise-5.0.4/app/helpers/devise_helper.rb +5 -0
- data/devise-5.0.4/app/mailers/devise/mailer.rb +30 -0
- data/devise-5.0.4/app/views/devise/confirmations/new.html.erb +16 -0
- data/devise-5.0.4/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/devise-5.0.4/app/views/devise/mailer/email_changed.html.erb +7 -0
- data/devise-5.0.4/app/views/devise/mailer/password_change.html.erb +3 -0
- data/devise-5.0.4/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/devise-5.0.4/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/devise-5.0.4/app/views/devise/passwords/edit.html.erb +25 -0
- data/devise-5.0.4/app/views/devise/passwords/new.html.erb +16 -0
- data/devise-5.0.4/app/views/devise/registrations/edit.html.erb +42 -0
- data/devise-5.0.4/app/views/devise/registrations/new.html.erb +29 -0
- data/devise-5.0.4/app/views/devise/sessions/new.html.erb +26 -0
- data/devise-5.0.4/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/devise-5.0.4/app/views/devise/shared/_links.html.erb +25 -0
- data/devise-5.0.4/app/views/devise/unlocks/new.html.erb +16 -0
- data/devise-5.0.4/config/locales/en.yml +65 -0
- data/devise-5.0.4/lib/devise/controllers/helpers.rb +295 -0
- data/devise-5.0.4/lib/devise/controllers/rememberable.rb +56 -0
- data/devise-5.0.4/lib/devise/controllers/responder.rb +35 -0
- data/devise-5.0.4/lib/devise/controllers/scoped_views.rb +19 -0
- data/devise-5.0.4/lib/devise/controllers/sign_in_out.rb +106 -0
- data/devise-5.0.4/lib/devise/controllers/store_location.rb +76 -0
- data/devise-5.0.4/lib/devise/controllers/url_helpers.rb +69 -0
- data/devise-5.0.4/lib/devise/delegator.rb +18 -0
- data/devise-5.0.4/lib/devise/encryptor.rb +24 -0
- data/devise-5.0.4/lib/devise/failure_app.rb +287 -0
- data/devise-5.0.4/lib/devise/hooks/activatable.rb +12 -0
- data/devise-5.0.4/lib/devise/hooks/csrf_cleaner.rb +14 -0
- data/devise-5.0.4/lib/devise/hooks/forgetable.rb +11 -0
- data/devise-5.0.4/lib/devise/hooks/lockable.rb +9 -0
- data/devise-5.0.4/lib/devise/hooks/proxy.rb +23 -0
- data/devise-5.0.4/lib/devise/hooks/rememberable.rb +9 -0
- data/devise-5.0.4/lib/devise/hooks/timeoutable.rb +35 -0
- data/devise-5.0.4/lib/devise/hooks/trackable.rb +11 -0
- data/devise-5.0.4/lib/devise/mailers/helpers.rb +87 -0
- data/devise-5.0.4/lib/devise/mapping.rb +178 -0
- data/devise-5.0.4/lib/devise/models/authenticatable.rb +302 -0
- data/devise-5.0.4/lib/devise/models/confirmable.rb +371 -0
- data/devise-5.0.4/lib/devise/models/database_authenticatable.rb +204 -0
- data/devise-5.0.4/lib/devise/models/lockable.rb +214 -0
- data/devise-5.0.4/lib/devise/models/omniauthable.rb +29 -0
- data/devise-5.0.4/lib/devise/models/recoverable.rb +156 -0
- data/devise-5.0.4/lib/devise/models/registerable.rb +29 -0
- data/devise-5.0.4/lib/devise/models/rememberable.rb +158 -0
- data/devise-5.0.4/lib/devise/models/timeoutable.rb +45 -0
- data/devise-5.0.4/lib/devise/models/trackable.rb +51 -0
- data/devise-5.0.4/lib/devise/models/validatable.rb +70 -0
- data/devise-5.0.4/lib/devise/models.rb +122 -0
- data/devise-5.0.4/lib/devise/modules.rb +30 -0
- data/devise-5.0.4/lib/devise/omniauth/config.rb +47 -0
- data/devise-5.0.4/lib/devise/omniauth/url_helpers.rb +27 -0
- data/devise-5.0.4/lib/devise/omniauth.rb +27 -0
- data/devise-5.0.4/lib/devise/orm/active_record.rb +7 -0
- data/devise-5.0.4/lib/devise/orm/mongoid.rb +7 -0
- data/devise-5.0.4/lib/devise/orm.rb +80 -0
- data/devise-5.0.4/lib/devise/parameter_filter.rb +44 -0
- data/devise-5.0.4/lib/devise/parameter_sanitizer.rb +172 -0
- data/devise-5.0.4/lib/devise/rails/routes.rb +514 -0
- data/devise-5.0.4/lib/devise/rails/warden_compat.rb +15 -0
- data/devise-5.0.4/lib/devise/rails.rb +57 -0
- data/devise-5.0.4/lib/devise/strategies/authenticatable.rb +178 -0
- data/devise-5.0.4/lib/devise/strategies/base.rb +22 -0
- data/devise-5.0.4/lib/devise/strategies/database_authenticatable.rb +31 -0
- data/devise-5.0.4/lib/devise/strategies/rememberable.rb +67 -0
- data/devise-5.0.4/lib/devise/test/controller_helpers.rb +156 -0
- data/devise-5.0.4/lib/devise/test/integration_helpers.rb +63 -0
- data/devise-5.0.4/lib/devise/time_inflector.rb +16 -0
- data/devise-5.0.4/lib/devise/token_generator.rb +32 -0
- data/devise-5.0.4/lib/devise/version.rb +5 -0
- data/devise-5.0.4/lib/devise.rb +533 -0
- data/devise-5.0.4/lib/generators/active_record/devise_generator.rb +119 -0
- data/devise-5.0.4/lib/generators/active_record/templates/migration.rb +20 -0
- data/devise-5.0.4/lib/generators/active_record/templates/migration_existing.rb +27 -0
- data/devise-5.0.4/lib/generators/devise/controllers_generator.rb +46 -0
- data/devise-5.0.4/lib/generators/devise/devise_generator.rb +28 -0
- data/devise-5.0.4/lib/generators/devise/install_generator.rb +42 -0
- data/devise-5.0.4/lib/generators/devise/orm_helpers.rb +36 -0
- data/devise-5.0.4/lib/generators/devise/views_generator.rb +145 -0
- data/devise-5.0.4/lib/generators/mongoid/devise_generator.rb +57 -0
- data/devise-5.0.4/lib/generators/templates/README +36 -0
- data/devise-5.0.4/lib/generators/templates/controllers/README +14 -0
- data/devise-5.0.4/lib/generators/templates/controllers/confirmations_controller.rb +30 -0
- data/devise-5.0.4/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +30 -0
- data/devise-5.0.4/lib/generators/templates/controllers/passwords_controller.rb +34 -0
- data/devise-5.0.4/lib/generators/templates/controllers/registrations_controller.rb +62 -0
- data/devise-5.0.4/lib/generators/templates/controllers/sessions_controller.rb +27 -0
- data/devise-5.0.4/lib/generators/templates/controllers/unlocks_controller.rb +30 -0
- data/devise-5.0.4/lib/generators/templates/devise.rb +316 -0
- data/devise-5.0.4/lib/generators/templates/markerb/confirmation_instructions.markerb +5 -0
- data/devise-5.0.4/lib/generators/templates/markerb/email_changed.markerb +7 -0
- data/devise-5.0.4/lib/generators/templates/markerb/password_change.markerb +3 -0
- data/devise-5.0.4/lib/generators/templates/markerb/reset_password_instructions.markerb +8 -0
- data/devise-5.0.4/lib/generators/templates/markerb/unlock_instructions.markerb +7 -0
- data/devise-5.0.4/lib/generators/templates/simple_form_for/confirmations/new.html.erb +20 -0
- data/devise-5.0.4/lib/generators/templates/simple_form_for/passwords/edit.html.erb +27 -0
- data/devise-5.0.4/lib/generators/templates/simple_form_for/passwords/new.html.erb +18 -0
- data/devise-5.0.4/lib/generators/templates/simple_form_for/registrations/edit.html.erb +35 -0
- data/devise-5.0.4/lib/generators/templates/simple_form_for/registrations/new.html.erb +25 -0
- data/devise-5.0.4/lib/generators/templates/simple_form_for/sessions/new.html.erb +20 -0
- data/devise-5.0.4/lib/generators/templates/simple_form_for/unlocks/new.html.erb +19 -0
- data/ultra-max-kit.gemspec +12 -0
- metadata +153 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# All Devise controllers are inherited from here.
|
|
4
|
+
class DeviseController < Devise.parent_controller.constantize
|
|
5
|
+
include Devise::Controllers::ScopedViews
|
|
6
|
+
|
|
7
|
+
if respond_to?(:helper)
|
|
8
|
+
helper DeviseHelper
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
if respond_to?(:helper_method)
|
|
12
|
+
helpers = %w(resource scope_name resource_name signed_in_resource
|
|
13
|
+
resource_class resource_params devise_mapping)
|
|
14
|
+
helper_method(*helpers)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
prepend_before_action :assert_is_devise_resource!
|
|
18
|
+
self.responder = Devise.responder
|
|
19
|
+
respond_to :html if mimes_for_respond_to.empty?
|
|
20
|
+
|
|
21
|
+
# Override prefixes to consider the scoped view.
|
|
22
|
+
# Notice we need to check for the request due to a bug in
|
|
23
|
+
# Action Controller tests that forces _prefixes to be
|
|
24
|
+
# loaded before even having a request object.
|
|
25
|
+
#
|
|
26
|
+
# This method should be public as it is in ActionPack
|
|
27
|
+
# itself. Changing its visibility may break other gems.
|
|
28
|
+
def _prefixes #:nodoc:
|
|
29
|
+
@_prefixes ||= if self.class.scoped_views? && request && devise_mapping
|
|
30
|
+
["#{devise_mapping.scoped_path}/#{controller_name}"] + super
|
|
31
|
+
else
|
|
32
|
+
super
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Override internal methods to exclude `_prefixes` from action methods since
|
|
37
|
+
# we override it above.
|
|
38
|
+
#
|
|
39
|
+
# There was an intentional change in Rails 7.1 that will allow it to become
|
|
40
|
+
# an action method because it's a public method of a non-abstract controller,
|
|
41
|
+
# but we also can't make this abstract because it can affect potential actions
|
|
42
|
+
# defined in the parent controller, so instead we ensure `_prefixes` is going
|
|
43
|
+
# to be considered internal. (and thus, won't become an action method.)
|
|
44
|
+
# Ref: https://github.com/rails/rails/pull/48699
|
|
45
|
+
def self.internal_methods #:nodoc:
|
|
46
|
+
super << :_prefixes
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
protected
|
|
50
|
+
|
|
51
|
+
# Gets the actual resource stored in the instance variable
|
|
52
|
+
def resource
|
|
53
|
+
instance_variable_get(:"@#{resource_name}")
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Proxy to devise map name
|
|
57
|
+
def resource_name
|
|
58
|
+
devise_mapping.name
|
|
59
|
+
end
|
|
60
|
+
alias :scope_name :resource_name
|
|
61
|
+
|
|
62
|
+
# Proxy to devise map class
|
|
63
|
+
def resource_class
|
|
64
|
+
devise_mapping.to
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Returns a signed in resource from session (if one exists)
|
|
68
|
+
def signed_in_resource
|
|
69
|
+
warden.authenticate(scope: resource_name)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Attempt to find the mapped route for devise based on request path
|
|
73
|
+
def devise_mapping
|
|
74
|
+
@devise_mapping ||= request.env["devise.mapping"]
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Checks whether it's a devise mapped resource or not.
|
|
78
|
+
def assert_is_devise_resource! #:nodoc:
|
|
79
|
+
unknown_action! <<-MESSAGE unless devise_mapping
|
|
80
|
+
Could not find devise mapping for path #{request.fullpath.inspect}.
|
|
81
|
+
This may happen for two reasons:
|
|
82
|
+
|
|
83
|
+
1) You forgot to wrap your route inside the scope block. For example:
|
|
84
|
+
|
|
85
|
+
devise_scope :user do
|
|
86
|
+
get "/some/route" => "some_devise_controller"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
2) You are testing a Devise controller bypassing the router.
|
|
90
|
+
If so, you can explicitly tell Devise which mapping to use:
|
|
91
|
+
|
|
92
|
+
@request.env["devise.mapping"] = Devise.mappings[:user]
|
|
93
|
+
|
|
94
|
+
MESSAGE
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Returns real navigational formats which are supported by Rails
|
|
98
|
+
def navigational_formats
|
|
99
|
+
@navigational_formats ||= Devise.navigational_formats.select { |format| Mime::EXTENSION_LOOKUP[format.to_s] }
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def unknown_action!(msg)
|
|
103
|
+
logger.debug "[Devise] #{msg}" if logger
|
|
104
|
+
raise AbstractController::ActionNotFound, msg
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Sets the resource creating an instance variable
|
|
108
|
+
def resource=(new_resource)
|
|
109
|
+
instance_variable_set(:"@#{resource_name}", new_resource)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Helper for use in before_actions where no authentication is required.
|
|
113
|
+
#
|
|
114
|
+
# Example:
|
|
115
|
+
# before_action :require_no_authentication, only: :new
|
|
116
|
+
def require_no_authentication
|
|
117
|
+
assert_is_devise_resource!
|
|
118
|
+
return unless is_navigational_format?
|
|
119
|
+
no_input = devise_mapping.no_input_strategies
|
|
120
|
+
|
|
121
|
+
authenticated = if no_input.present?
|
|
122
|
+
args = no_input.dup.push scope: resource_name
|
|
123
|
+
warden.authenticate?(*args)
|
|
124
|
+
else
|
|
125
|
+
warden.authenticated?(resource_name)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if authenticated && resource = warden.user(resource_name)
|
|
129
|
+
set_flash_message(:alert, 'already_authenticated', scope: 'devise.failure')
|
|
130
|
+
redirect_to after_sign_in_path_for(resource)
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Helper for use after calling send_*_instructions methods on a resource.
|
|
135
|
+
# If we are in paranoid mode, we always act as if the resource was valid
|
|
136
|
+
# and instructions were sent.
|
|
137
|
+
def successfully_sent?(resource)
|
|
138
|
+
notice = if Devise.paranoid
|
|
139
|
+
resource.errors.clear
|
|
140
|
+
:send_paranoid_instructions
|
|
141
|
+
elsif resource.errors.empty?
|
|
142
|
+
:send_instructions
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if notice
|
|
146
|
+
set_flash_message! :notice, notice
|
|
147
|
+
true
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Sets the flash message with :key, using I18n. By default you are able
|
|
152
|
+
# to set up your messages using specific resource scope, and if no message is
|
|
153
|
+
# found we look to the default scope. Set the "now" options key to a true
|
|
154
|
+
# value to populate the flash.now hash in lieu of the default flash hash (so
|
|
155
|
+
# the flash message will be available to the current action instead of the
|
|
156
|
+
# next action).
|
|
157
|
+
# Example (i18n locale file):
|
|
158
|
+
#
|
|
159
|
+
# en:
|
|
160
|
+
# devise:
|
|
161
|
+
# passwords:
|
|
162
|
+
# #default_scope_messages - only if resource_scope is not found
|
|
163
|
+
# user:
|
|
164
|
+
# #resource_scope_messages
|
|
165
|
+
#
|
|
166
|
+
# Please refer to README or en.yml locale file to check what messages are
|
|
167
|
+
# available.
|
|
168
|
+
def set_flash_message(key, kind, options = {})
|
|
169
|
+
message = find_message(kind, options)
|
|
170
|
+
if options[:now]
|
|
171
|
+
flash.now[key] = message if message.present?
|
|
172
|
+
else
|
|
173
|
+
flash[key] = message if message.present?
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Sets flash message if is_flashing_format? equals true
|
|
178
|
+
def set_flash_message!(key, kind, options = {})
|
|
179
|
+
if is_flashing_format?
|
|
180
|
+
set_flash_message(key, kind, options)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Sets minimum password length to show to user
|
|
185
|
+
def set_minimum_password_length
|
|
186
|
+
if devise_mapping.validatable?
|
|
187
|
+
@minimum_password_length = resource_class.password_length.min
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def devise_i18n_options(options)
|
|
192
|
+
options
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Get message for given
|
|
196
|
+
def find_message(kind, options = {})
|
|
197
|
+
options[:scope] ||= translation_scope
|
|
198
|
+
options[:default] = Array(options[:default]).unshift(kind.to_sym)
|
|
199
|
+
options[:resource_name] = resource_name
|
|
200
|
+
options = devise_i18n_options(options)
|
|
201
|
+
I18n.t("#{options[:resource_name]}.#{kind}", **options)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Controllers inheriting DeviseController are advised to override this
|
|
205
|
+
# method so that other controllers inheriting from them would use
|
|
206
|
+
# existing translations.
|
|
207
|
+
def translation_scope
|
|
208
|
+
"devise.#{controller_name}"
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def clean_up_passwords(object)
|
|
212
|
+
object.clean_up_passwords if object.respond_to?(:clean_up_passwords)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def respond_with_navigational(*args, &block)
|
|
216
|
+
respond_with(*args) do |format|
|
|
217
|
+
format.any(*navigational_formats, &block)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def resource_params
|
|
222
|
+
params.fetch(resource_name, {})
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
ActiveSupport.run_load_hooks(:devise_controller, self)
|
|
226
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
if defined?(ActionMailer)
|
|
4
|
+
class Devise::Mailer < Devise.parent_mailer.constantize
|
|
5
|
+
include Devise::Mailers::Helpers
|
|
6
|
+
|
|
7
|
+
def confirmation_instructions(record, token, opts = {})
|
|
8
|
+
@token = token
|
|
9
|
+
devise_mail(record, :confirmation_instructions, opts)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def reset_password_instructions(record, token, opts = {})
|
|
13
|
+
@token = token
|
|
14
|
+
devise_mail(record, :reset_password_instructions, opts)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def unlock_instructions(record, token, opts = {})
|
|
18
|
+
@token = token
|
|
19
|
+
devise_mail(record, :unlock_instructions, opts)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def email_changed(record, opts = {})
|
|
23
|
+
devise_mail(record, :email_changed, opts)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def password_change(record, opts = {})
|
|
27
|
+
devise_mail(record, :password_change, opts)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<p><%= f.label :email %></p>
|
|
8
|
+
<p><%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %></p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="actions">
|
|
12
|
+
<%= f.submit "Resend confirmation instructions" %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= render "devise/shared/links" %>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<p>Hello <%= @email %>!</p>
|
|
2
|
+
|
|
3
|
+
<% if @resource.try(:unconfirmed_email?) %>
|
|
4
|
+
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
|
|
5
|
+
<% else %>
|
|
6
|
+
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
|
|
7
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
|
2
|
+
|
|
3
|
+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
|
4
|
+
|
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
|
|
6
|
+
|
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
|
2
|
+
|
|
3
|
+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
|
4
|
+
|
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
|
6
|
+
|
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<h2>Change your password</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
|
6
|
+
|
|
7
|
+
<div class="field">
|
|
8
|
+
<p><%= f.label :password, "New password" %></p>
|
|
9
|
+
<% if @minimum_password_length %>
|
|
10
|
+
<p><em>(<%= @minimum_password_length %> characters minimum)</em></p>
|
|
11
|
+
<% end %>
|
|
12
|
+
<p><%= f.password_field :password, autofocus: true, autocomplete: "new-password" %></p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="field">
|
|
16
|
+
<p><%= f.label :password_confirmation, "Confirm new password" %></p>
|
|
17
|
+
<p><%= f.password_field :password_confirmation, autocomplete: "new-password" %></p>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="actions">
|
|
21
|
+
<%= f.submit "Change my password" %>
|
|
22
|
+
</div>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
25
|
+
<%= render "devise/shared/links" %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h2>Forgot your password?</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<p><%= f.label :email %></p>
|
|
8
|
+
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="actions">
|
|
12
|
+
<%= f.submit "Send me password reset instructions" %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= render "devise/shared/links" %>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<p><%= f.label :email %></p>
|
|
8
|
+
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
|
12
|
+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
|
13
|
+
<% end %>
|
|
14
|
+
|
|
15
|
+
<div class="field">
|
|
16
|
+
<p><%= f.label :password %> <i>(leave blank if you don't want to change it)</i></p>
|
|
17
|
+
<p><%= f.password_field :password, autocomplete: "new-password" %></p>
|
|
18
|
+
<% if @minimum_password_length %>
|
|
19
|
+
<p><em><%= @minimum_password_length %> characters minimum</em></p>
|
|
20
|
+
<% end %>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="field">
|
|
24
|
+
<p><%= f.label :password_confirmation %></p>
|
|
25
|
+
<p><%= f.password_field :password_confirmation, autocomplete: "new-password" %></p>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="field">
|
|
29
|
+
<p><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i></p>
|
|
30
|
+
<p><%= f.password_field :current_password, autocomplete: "current-password" %></p>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="actions">
|
|
34
|
+
<%= f.submit "Update" %>
|
|
35
|
+
</div>
|
|
36
|
+
<% end %>
|
|
37
|
+
|
|
38
|
+
<h3>Cancel my account</h3>
|
|
39
|
+
|
|
40
|
+
<div>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %></div>
|
|
41
|
+
|
|
42
|
+
<%= link_to "Back", :back %>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<h2>Sign up</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<p><%= f.label :email %></p>
|
|
8
|
+
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="field">
|
|
12
|
+
<p><%= f.label :password %></p>
|
|
13
|
+
<% if @minimum_password_length %>
|
|
14
|
+
<p><em>(<%= @minimum_password_length %> characters minimum)</em></p>
|
|
15
|
+
<% end %>
|
|
16
|
+
<p><%= f.password_field :password, autocomplete: "new-password" %></p>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<p><%= f.label :password_confirmation %></p>
|
|
21
|
+
<p><%= f.password_field :password_confirmation, autocomplete: "new-password" %></p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="actions">
|
|
25
|
+
<%= f.submit "Sign up" %>
|
|
26
|
+
</div>
|
|
27
|
+
<% end %>
|
|
28
|
+
|
|
29
|
+
<%= render "devise/shared/links" %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<h2>Log in</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
|
4
|
+
<div class="field">
|
|
5
|
+
<p><%= f.label :email %></p>
|
|
6
|
+
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="field">
|
|
10
|
+
<p><%= f.label :password %></p>
|
|
11
|
+
<p><%= f.password_field :password, autocomplete: "current-password" %></p>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<% if devise_mapping.rememberable? %>
|
|
15
|
+
<div class="field">
|
|
16
|
+
<p><%= f.check_box :remember_me %></p>
|
|
17
|
+
<p><%= f.label :remember_me %></p>
|
|
18
|
+
</div>
|
|
19
|
+
<% end %>
|
|
20
|
+
|
|
21
|
+
<div class="actions">
|
|
22
|
+
<%= f.submit "Log in" %>
|
|
23
|
+
</div>
|
|
24
|
+
<% end %>
|
|
25
|
+
|
|
26
|
+
<%= render "devise/shared/links" %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<% if resource.errors.any? %>
|
|
2
|
+
<div id="error_explanation" data-turbo-temporary>
|
|
3
|
+
<h2>
|
|
4
|
+
<%= I18n.t("errors.messages.not_saved",
|
|
5
|
+
count: resource.errors.count,
|
|
6
|
+
resource: resource.class.model_name.human.downcase)
|
|
7
|
+
%>
|
|
8
|
+
</h2>
|
|
9
|
+
<ul>
|
|
10
|
+
<% resource.errors.full_messages.each do |message| %>
|
|
11
|
+
<li><%= message %></li>
|
|
12
|
+
<% end %>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
|
2
|
+
<p><%= link_to "Log in", new_session_path(resource_name) %></p>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
|
6
|
+
<p><%= link_to "Sign up", new_registration_path(resource_name) %></p>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
|
10
|
+
<p><%= link_to "Forgot your password?", new_password_path(resource_name) %></p>
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
|
14
|
+
<p><%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %></p>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
|
18
|
+
<p><%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %></p>
|
|
19
|
+
<% end %>
|
|
20
|
+
|
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
|
23
|
+
<p><%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %></p>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
|
+
|
|
6
|
+
<div class="field">
|
|
7
|
+
<p><%= f.label :email %></p>
|
|
8
|
+
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="actions">
|
|
12
|
+
<%= f.submit "Resend unlock instructions" %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= render "devise/shared/links" %>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Additional translations at https://github.com/heartcombo/devise/wiki/I18n
|
|
2
|
+
|
|
3
|
+
en:
|
|
4
|
+
devise:
|
|
5
|
+
confirmations:
|
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
|
9
|
+
failure:
|
|
10
|
+
already_authenticated: "You are already signed in."
|
|
11
|
+
inactive: "Your account is not activated yet."
|
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
|
13
|
+
locked: "Your account is locked."
|
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
|
19
|
+
mailer:
|
|
20
|
+
confirmation_instructions:
|
|
21
|
+
subject: "Confirmation instructions"
|
|
22
|
+
reset_password_instructions:
|
|
23
|
+
subject: "Reset password instructions"
|
|
24
|
+
unlock_instructions:
|
|
25
|
+
subject: "Unlock instructions"
|
|
26
|
+
email_changed:
|
|
27
|
+
subject: "Email Changed"
|
|
28
|
+
password_change:
|
|
29
|
+
subject: "Password Changed"
|
|
30
|
+
omniauth_callbacks:
|
|
31
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
|
32
|
+
success: "Successfully authenticated from %{kind} account."
|
|
33
|
+
passwords:
|
|
34
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
|
35
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
|
36
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
|
37
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
|
38
|
+
updated_not_active: "Your password has been changed successfully."
|
|
39
|
+
registrations:
|
|
40
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
|
41
|
+
signed_up: "Welcome! You have signed up successfully."
|
|
42
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
|
43
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
|
44
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
|
45
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
|
|
46
|
+
updated: "Your account has been updated successfully."
|
|
47
|
+
updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
|
|
48
|
+
sessions:
|
|
49
|
+
signed_in: "Signed in successfully."
|
|
50
|
+
signed_out: "Signed out successfully."
|
|
51
|
+
already_signed_out: "Signed out successfully."
|
|
52
|
+
unlocks:
|
|
53
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
|
54
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
|
55
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
|
56
|
+
errors:
|
|
57
|
+
messages:
|
|
58
|
+
already_confirmed: "was already confirmed, please try signing in"
|
|
59
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
|
60
|
+
expired: "has expired, please request a new one"
|
|
61
|
+
not_found: "not found"
|
|
62
|
+
not_locked: "was not locked"
|
|
63
|
+
not_saved:
|
|
64
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
|
65
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|