add ability to configure terms and conditions

This commit is contained in:
Josh
2018-06-21 16:17:18 -04:00
parent 2dc033ee20
commit c16197670b
12 changed files with 67 additions and 10 deletions

View File

@ -3,7 +3,13 @@ module SessionsHelper
# Logs a user into GreenLight.
def login(user)
session[:user_id] = user.id
redirect_to user.main_room
# If there are not terms, or the user has accepted them, go to their room.
if !Rails.configuration.terms || user.accepted_terms then
redirect_to user.main_room
else
redirect_to terms_path
end
end
# Logs current user out of GreenLight.