Sha256: cb3f56bebf412cc305da4f22c7b7bf64d69f9bd19aac6434166a20b9a3782341

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

module RademadeAdmin
  class SessionsController < RademadeAdmin::AbstractController

    skip_before_action :require_login

    def create
      begin
        user = RademadeAdmin::Login.admin( params )
        sign_in user
        render :json => user, :status => :ok
      rescue RademadeAdmin::Login::Error => e
        render :json => {:errors => e.field_messages}, :status => :precondition_failed
      end
    end

    def logout
      sign_out current_user
      redirect_to :controller => 'dashboard', :action => 'login'
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rademade_admin-0.0.1 app/controllers/rademade_admin/sessions_controller.rb