Sha256: fa6bc30918404e9b72aa349fc00e09705e1522d8fbac3089aa782967ecba8118

Contents?: true

Size: 627 Bytes

Versions: 2

Compression:

Stored size: 627 Bytes

Contents

module Ixtlan
  module Controllers
    module AuthenticationsController

      def self.included(base)
        base.skip_before_filter :guard
        base.skip_before_filter :authenticate, :only => :destroy
      end

      protected
      def login_from_params
        auth = params[:authentication]
        User.authenticate(auth[:login], auth[:password])
      end

      public
      def create
        render_successful_login
      end

      def destroy
        authentication_logger.log_user(current_user.nil? ? nil : current_user.login, "logged out")
        session.clear
        head :ok
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ixtlan-0.4.0.pre4 lib/ixtlan/controllers/authentications_controller.rb
ixtlan-0.4.0.pre3 lib/ixtlan/controllers/authentications_controller.rb