Class: UserMgmt::RegistrationsController
Instance Method Summary
collapse
#change_email, #change_password, #current_user, #delete_user, #get_email, #log_in, #log_in_oauth, #log_out, #remove_strategy, #reset_password, #reset_password_request, #sign_up, #sign_up_oauth, #user_info, #user_logged_in?
#main_page
Instance Method Details
#add_strategy ⇒ Object
32
33
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 32
def add_strategy
end
|
#create ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 12
def create
response = sign_up *params[:user].values
if response[:status] == "200"
flash[:success] = "User was created succesfully!"
session[:user_session_id] = response[:body]["session"]
redirect_to main_app.root_path
else
flash[:error] = response[:body]
redirect_to sign_up_path
end
end
|
#edit ⇒ Object
28
29
30
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 28
def edit
end
|
#new ⇒ Object
7
8
9
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 7
def new
end
|
#password_reset ⇒ Object
35
36
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 35
def password_reset
end
|
#password_reset_request ⇒ Object
49
50
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 49
def password_reset_request
end
|
#send_password_reset ⇒ Object
38
39
40
41
42
43
44
45
46
47
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 38
def send_password_reset
response = reset_password params[:user][:reset_token], params[:user][:new_pw], params[:user][:new_pw_confirm]
if response[:status] == "200"
flash[:success] = "Password reset succesfully!"
redirect_to log_in_path
else
flash[:error] = "Password could not be updated. Please try again later."
redirect_to password_reset_path
end
end
|
#send_reset_request ⇒ Object
52
53
54
55
|
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 52
def send_reset_request
reset_password_request params[:user][:email]
redirect_to password_reset_path
end
|