Sha256: e7dfdd4191825c1cba33be1f82ac069e63ef35e93ccc618e7689a23f4a6a581c

Contents?: true

Size: 424 Bytes

Versions: 3

Compression:

Stored size: 424 Bytes

Contents

class SessionsController < ApplicationController

  def new
    flash.now.alert = warden.message if warden.message.present?
  end

  def create
    user = warden.authenticate!
    if user
      redirect_to after_login_path, notice: "Logged In"
    else
      flash.now.alert = warden.message
      render :new
    end
  end

  def destroy
    warden.logout
    redirect_to after_logout_path, notice: "Logged out"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thincloud-auth-0.1.2 lib/generators/thincloud/auth/templates/sessions_controller.rb
thincloud-auth-0.1.1 lib/generators/thincloud/auth/templates/sessions_controller.rb
thincloud-auth-0.1.0 lib/generators/thincloud/auth/templates/sessions_controller.rb