mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-24 01:32:40 -04:00
destroy member if password correct
This commit is contained in:
@@ -35,6 +35,14 @@ class RegistrationsController < Devise::RegistrationsController
|
||||
render "edit"
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @member.destroy_with_password(params.require(:member)[:current_password])
|
||||
redirect_to root_path
|
||||
else
|
||||
render "edit"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# check if we need the current password to update fields
|
||||
|
||||
Reference in New Issue
Block a user