forked from External/greenlight
add ability to configure terms and conditions
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user