Class: SimplyAuth::SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/simply_auth/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
# File 'app/controllers/simply_auth/sessions_controller.rb', line 12

def create
  @session = SimplyAuth::Session.new(session_params)
  if @session.save
    session[:simply_auth_session_id] = @session.id
    redirect_to "/"
  else
    render :new
  end
end

#destroyObject



22
23
24
25
26
# File 'app/controllers/simply_auth/sessions_controller.rb', line 22

def destroy
  current_session.destroy
  session.destroy
  redirect_to "/"
end

#newObject



3
4
5
# File 'app/controllers/simply_auth/sessions_controller.rb', line 3

def new
  @session = SimplyAuth::Session.new(permit_session_params)
end

#showObject



7
8
9
10
# File 'app/controllers/simply_auth/sessions_controller.rb', line 7

def show
  #handle refreshing on validation error
  redirect_to new_session_path
end