Make supplier signup working as expected

This commit is contained in:
2013-12-22 12:30:22 +01:00
parent c6f790eccd
commit ff10d9360b
8 changed files with 45 additions and 13 deletions
@@ -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