forked from consuldemocracy/consuldemocracy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
account_controller.rb
34 lines (25 loc) · 757 Bytes
/
account_controller.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class Management::AccountController < Management::BaseController
before_action :only_verified_users
def show
end
def edit
end
def print_password
end
def reset_password
managed_user.send_reset_password_instructions
redirect_to management_account_path, notice: t("management.account.edit.password.reset_email_send")
end
def change_password
if managed_user.reset_password(params[:user][:password], params[:user][:password])
session[:new_password] = params[:user][:password]
redirect_to print_password_management_account_path
else
render :edit_password_manually
end
end
private
def only_verified_users
check_verified_user t("management.account.alert.unverified_user")
end
end