mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +01:00
16 lines
380 B
Ruby
16 lines
380 B
Ruby
|
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
|
||
|
|
||
|
def current_user
|
||
|
User.find(session[:user_id]) if session[:user_id].present?
|
||
|
end
|
||
|
|
||
|
def signed_in?
|
||
|
!!current_user
|
||
|
end
|
||
|
|
||
|
helper_method :current_user, :signed_in?
|
||
|
end
|