Class: UserMgmt::RegistrationsController

Inherits:
ApplicationController show all
Includes:
ApplicationHelper
Defined in:
app/controllers/user_mgmt/registrations_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#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?

Methods inherited from ApplicationController

#main_page

Instance Method Details

#add_strategyObject



32
33
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 32

def add_strategy
end

#createObject

POST /user



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 =  *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       
  end

end

#editObject

GET /user/edit



28
29
30
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 28

def edit

end

#newObject

GET /user/sign_up



7
8
9
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 7

def new

end

#password_resetObject



35
36
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 35

def password_reset
end

#password_reset_requestObject



49
50
# File 'app/controllers/user_mgmt/registrations_controller.rb', line 49

def password_reset_request
end

#send_password_resetObject



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 
  else
    flash[:error] = "Password could not be updated. Please try again later."
    redirect_to password_reset_path
  end
end

#send_reset_requestObject



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