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