Sha256: affb0c0fdcc1599cf9b439058617a9baceb3a836d3baf6289a27e747e5a4a4f7

Contents?: true

Size: 854 Bytes

Versions: 14

Compression:

Stored size: 854 Bytes

Contents

class SessionsController < ApplicationController
  include Devise::Controllers::Helpers

  before_filter :require_no_authentication, :only => [ :new, :create ]

  # GET /resource/sign_in
  def new
    Devise::FLASH_MESSAGES.each do |message|
      set_now_flash_message :failure, message if params.try(:[], message) == "true"
    end
    build_resource
    render_with_scope :new
  end

  # POST /resource/sign_in
  def create
    if authenticate(resource_name)
      set_flash_message :success, :signed_in
      sign_in_and_redirect(resource_name)
    else
      set_now_flash_message :failure, warden.message || :invalid
      build_resource
      render_with_scope :new
    end
  end

  # GET /resource/sign_out
  def destroy
    set_flash_message :success, :signed_out if signed_in?(resource_name)
    sign_out_and_redirect(resource_name)
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
devise-0.8.2 app/controllers/sessions_controller.rb
devise-0.8.1 app/controllers/sessions_controller.rb
devise-0.8.0 app/controllers/sessions_controller.rb
devise-0.7.5 app/controllers/sessions_controller.rb
devise-0.7.4 app/controllers/sessions_controller.rb
devise-0.7.3 app/controllers/sessions_controller.rb
devise-0.7.2 app/controllers/sessions_controller.rb
devise-0.7.1 app/controllers/sessions_controller.rb
devise-0.7.0 app/controllers/sessions_controller.rb
devise-0.6.3 app/controllers/sessions_controller.rb
devise-0.6.2 app/controllers/sessions_controller.rb
devise-0.6.1 app/controllers/sessions_controller.rb
devise-0.6.0 app/controllers/sessions_controller.rb
devise-0.5.6 app/controllers/sessions_controller.rb