Class: Hello::Authentication::SessionsController

Inherits:
Hello::ApplicationController show all
Defined in:
app/controllers/hello/authentication/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject

DELETE /hello/sessions/1



34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/hello/authentication/sessions_controller.rb', line 34

def destroy
  sign_out!(@access)

  business = Hello::Business::Authentication::SignOut.new

  respond_to do |format|
    format.html { redirect_to hello.sessions_path, notice: business.success_message }
    format.json { head :reset_content }
  end
end

#indexObject

GET /hello/sessions



12
13
14
# File 'app/controllers/hello/authentication/sessions_controller.rb', line 12

def index
  render_list
end

#newObject

GET /hello/sessions/new



17
18
19
# File 'app/controllers/hello/authentication/sessions_controller.rb', line 17

def new
  render_new
end

#showObject

GET /hello/sessions/1



22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/hello/authentication/sessions_controller.rb', line 22

def show
  self.session_token = @access.token

  business = Hello::Business::Authentication::SignIn.new

  respond_to do |format|
    format.html { redirect_to hello.sessions_path, notice: business.success_message }
    format.json { head :reset_content }
  end
end

#sign_outObject

get /hello/sign_out



46
47
48
49
50
51
52
53
54
55
# File 'app/controllers/hello/authentication/sessions_controller.rb', line 46

def sign_out
  sign_out!

  business = Hello::Business::Authentication::SignOut.new

  respond_to do |format|
    format.html { redirect_to '/', notice: business.success_message }
    format.json { head :reset_content }
  end
end