Sha256: 3e597644dea7c61d28b5487b4a36ace34656d25293f55182f8c055e74eb3699b

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  config.whitelisted_ips = '0.0.0.0'

  def sign_in(user)
    if user
      session[:user_id] = user.id
    end
  end

  protected
  include ApplicationHelper

  def authenticate!
    unless signed_in?
      flash[:error] = "You must first sign in before requesting that page"
      return redirect_to :signin
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
distribot-ui-0.1.0 app/controllers/application_controller.rb