Sha256: 7232834e39ac7bd9f5ac12557ef464e931c10b25c1d586ba46c36367b45c1f2f

Contents?: true

Size: 840 Bytes

Versions: 2

Compression:

Stored size: 840 Bytes

Contents

class SessionsController < ApplicationController
  layout 'sessions'
  skip_before_filter :require_puavo_authorization, :only => [:new, :create]
  skip_before_filter :require_login, :only => [:new, :create]

  def new
  end

  def create
    session[:uid] = params[:user][:uid]
    session[:password_plaintext] = params[:user][:password]
    session[:login_flash] = t('flash.session.login_successful')
    redirect_back_or_default root_path
  end

  def show
    @user = current_user
    respond_to do |format|
      format.json  { render :json => @user.to_json(:methods => :managed_schools) }
    end
  end

  def destroy
    # Remove dn and plaintext password values from session
    session.delete :password_plaintext
    session.delete :uid
    flash[:notice] = t('flash.session.logout_successful')
    redirect_to login_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puavo_authentication-0.2.2 app/controllers/sessions_controller.rb
puavo_authentication-0.2.1 app/controllers/sessions_controller.rb