about summary refs log tree commit diff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-15 10:44:59 -0400
committerEugen <eugen@zeonfederated.com>2017-04-15 16:44:59 +0200
commit6670e6d33fa735b6199e3b962f62ed6d1442bae1 (patch)
treecdd5aefe392f73cd456e2bf376645eea0f4a8754 /app/controllers/admin
parent9d2f55ecc3cc6bef9dc79ad8faf444261736976b (diff)
Add password reset for users from admin accounts area (#1841)
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/resets_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/admin/resets_controller.rb b/app/controllers/admin/resets_controller.rb
new file mode 100644
index 000000000..6db648403
--- /dev/null
+++ b/app/controllers/admin/resets_controller.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+module Admin
+  class ResetsController < BaseController
+    before_action :set_account
+
+    def create
+      @account.user.send_reset_password_instructions
+      redirect_to admin_accounts_path
+    end
+
+    private
+
+    def set_account
+      @account = Account.find(params[:account_id])
+    end
+  end
+end