mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Moves minimum_password_length to DeviseController.
This commit is contained in:
@@ -23,10 +23,7 @@ class Devise::PasswordsController < DeviseController
|
||||
# GET /resource/password/edit?reset_password_token=abcdef
|
||||
def edit
|
||||
self.resource = resource_class.new
|
||||
@validatable = devise_mapping.validatable?
|
||||
if @validatable
|
||||
@minimum_password_length = resource_class.password_length.min
|
||||
end
|
||||
set_minimum_password_length
|
||||
resource.reset_password_token = params[:reset_password_token]
|
||||
end
|
||||
|
||||
|
||||
@@ -5,10 +5,7 @@ class Devise::RegistrationsController < DeviseController
|
||||
# GET /resource/sign_up
|
||||
def new
|
||||
build_resource({})
|
||||
@validatable = devise_mapping.validatable?
|
||||
if @validatable
|
||||
@minimum_password_length = resource_class.password_length.min
|
||||
end
|
||||
set_minimum_password_length
|
||||
yield resource if block_given?
|
||||
respond_with self.resource
|
||||
end
|
||||
@@ -31,10 +28,7 @@ class Devise::RegistrationsController < DeviseController
|
||||
end
|
||||
else
|
||||
clean_up_passwords resource
|
||||
@validatable = devise_mapping.validatable?
|
||||
if @validatable
|
||||
@minimum_password_length = resource_class.password_length.min
|
||||
end
|
||||
set_minimum_password_length
|
||||
respond_with resource
|
||||
end
|
||||
end
|
||||
|
||||
@@ -154,6 +154,14 @@ MESSAGE
|
||||
end
|
||||
end
|
||||
|
||||
# Sets minimum password length to show to user
|
||||
def set_minimum_password_length
|
||||
@validatable = devise_mapping.validatable?
|
||||
if @validatable
|
||||
@minimum_password_length = resource_class.password_length.min
|
||||
end
|
||||
end
|
||||
|
||||
def devise_i18n_options(options)
|
||||
options
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user