Sha256: 43bafee44bf2f9797015781c69f08362f58579bf84a29ee6ca4f015c9c85a16b

Contents?: true

Size: 493 Bytes

Versions: 1

Compression:

Stored size: 493 Bytes

Contents

class Ninsho::SessionsController < NinshoController

  def new
    @providers = Ninsho.providers
  end

  def create
    resource = build_resource_from_omniauth
    if resource.authenticated?
      sign_in resource.send(Ninsho.parent_resource_name.to_s.downcase).id
      flash_message(:notice, :signed_in)
      redirect_on_sign_in_path
    else
      redirect_to_root
    end
  end

  def destroy
    sign_out 
    flash_message(:notice, :signed_out)
    redirect_on_sign_out_path
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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