Make supplier signup working as expected
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
class ConfirmationsController < Devise::ConfirmationsController
|
||||
|
||||
# GET /resource/confirmation?confirmation_token=abcdef
|
||||
# hack described by:
|
||||
# https://github.com/plataformatec/devise/pull/2728
|
||||
# restore sign_in after confirmation behaviour. More unsafe, but
|
||||
# customer satisfaction is dominant here
|
||||
def show
|
||||
super do |resource|
|
||||
sign_in(resource_name, resource) if resource && resource.errors.empty?
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def after_confirmation_path_for(resource_name, resource)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class RegistrationsController < Devise::RegistrationsController
|
||||
|
||||
private
|
||||
|
||||
# override devise internal to allow name as sign_up param
|
||||
def sign_up_params
|
||||
params.require(resource_name).permit resource_class.authentication_keys + [:name, :password, :password_confirmation]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user