Class: AutomaticLogout::SessionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/automatic_logout/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/automatic_logout/sessions_controller.rb', line 16

def destroy
  session[:auto_session_expires_at] = ''
  session[:seconds] = ''
  session[:live] = !!current_user

  reset_session

  redirect_to root_path, notice: session[:message]
end

#statusObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/automatic_logout/sessions_controller.rb', line 5

def status
  response = {
    live: !!current_user,
    timeout: session[:auto_session_expires_at],
    message: session[:message],
    seconds: session[:seconds]
  }

  render json: response
end