This repository has been archived on 2021-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
greenlight/app/controllers/main_controller.rb

20 lines
450 B
Ruby

# frozen_string_literal: true
class MainController < ApplicationController
# before_action :redirect_to_room
# GET /
def index
if Rails.env.production? && !current_user
redirect_to "#{Rails.configuration.relative_url_root}/auth/bn_launcher"
end
end
private
def redirect_to_room
# If the user is logged in already, move them along to their room.
redirect_to room_path(current_user.room) if current_user
end
end