Module: LatoSpaces::Groupable

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
app/controllers/concerns/lato_spaces/groupable.rb

Instance Method Summary collapse

Instance Method Details

#authenticate_groupObject



4
5
6
7
8
9
10
11
# File 'app/controllers/concerns/lato_spaces/groupable.rb', line 4

def authenticate_group
  if @session.get(:spaces_group_id).blank?
    redirect_to lato_spaces.root_path
    return false
  end

  true
end

#session_group_create(group_id) ⇒ Object



13
14
15
16
17
18
# File 'app/controllers/concerns/lato_spaces/groupable.rb', line 13

def session_group_create(group_id)
  cookies.encrypted[:lato_session] = { value: Lato::Session.generate_session_per_user(@session.user_id, spaces_group_id: group_id), expires: Lato.config.session_lifetime.from_now }
  @session = Lato::Session.new(cookies.encrypted[:lato_session])

  true
end