Class: SimplyAuth::SessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/simply_auth/sessions_controller.rb', line 7

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

#destroyObject



17
18
19
20
21
# File 'app/controllers/simply_auth/sessions_controller.rb', line 17

def destroy
  current_session.destroy
  session.destroy
  redirect_to main_app.root_path
end

#newObject



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

def new
  @session = SimplyAuth::Session.new
end