diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js index fad81029..cd4097e2 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/landing.js @@ -131,7 +131,7 @@ } }; - var initIndex = function() { + var initMeetings = function() { $('.generate-link').click (function (e) { e.preventDefault(); @@ -157,8 +157,10 @@ $(document).on("turbolinks:load", function() { if ($("body[data-controller=landing]").get(0)) { init(); - if ($("body[data-action=meetings]").get(0)) { - initIndex(); + if ($("body[data-action=index]").get(0)) { + initMeetings(); + } else if ($("body[data-action=meetings]").get(0)) { + initMeetings(); } else if ($("body[data-action=rooms]").get(0)) { initRooms(); } diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index ca336cdc..3f14be1b 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -2,6 +2,9 @@ class LandingController < ApplicationController include BbbApi def index + end + + def resource if params[:resource] == 'meetings' render_meeting elsif params[:resource] == 'rooms' diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 54a0f3b5..d5c6bd50 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -2,7 +2,7 @@ class SessionsController < ApplicationController def create @user = User.from_omniauth(request.env['omniauth.auth']) session[:user_id] = @user.id - redirect_to controller: 'landing', action: 'index', id: @user.encrypted_id, resource: 'rooms' + redirect_to @user.room_url rescue => e logger.error "Error authenticating via omniauth: #{e}" redirect_to root_path diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb new file mode 100644 index 00000000..37cfdf13 --- /dev/null +++ b/app/views/landing/index.html.erb @@ -0,0 +1,33 @@ +<% content_for :title do %> +