class FoundersToolkit::Auth::Securable::SessionsController

Public Instance Methods

create() click to toggle source
# File lib/founders_toolkit/auth/securable/sessions_controller.rb, line 11
def create
  @user = User.find_by(email: params[:email])

  if @user&.authenticate(params[:password])
    session[:user_id] = @user.id
    redirect_to after_login_path
  else
    redirect_to new_session_path, alert: 'We could not sign you in with those credentials.'
  end
end
destroy() click to toggle source
# File lib/founders_toolkit/auth/securable/sessions_controller.rb, line 22
def destroy
  reset_session
  redirect_to after_logout_path
end
new() click to toggle source
# File lib/founders_toolkit/auth/securable/sessions_controller.rb, line 9
def new; end

Private Instance Methods

after_login_path() click to toggle source
# File lib/founders_toolkit/auth/securable/sessions_controller.rb, line 29
def after_login_path
  root_path
end
after_logout_path() click to toggle source
# File lib/founders_toolkit/auth/securable/sessions_controller.rb, line 33
def after_logout_path
  root_path
end