From b23715c9066641dfbf89c48328527ac3efea33a8 Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Wed, 19 Aug 2020 16:03:10 -0400 Subject: [PATCH] Changed room joining post to hopefully fix CSRF errors (#2027) --- app/assets/javascripts/wait.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/app/assets/javascripts/wait.js b/app/assets/javascripts/wait.js index f619f26a..6df0f098 100644 --- a/app/assets/javascripts/wait.js +++ b/app/assets/javascripts/wait.js @@ -52,22 +52,7 @@ $(document).on("turbolinks:load", function(){ var join_attempts = 0; var request_to_join_meeting = function(){ - $.ajax({ - url: window.location.pathname, - type: 'POST', - data: { - join_name: $(".background").attr("join-name") - }, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') - }, - success: function(){ - // Enqueue another trial just incase they didn't actually join. - if(join_attempts < 4){ setTimeout(request_to_join_meeting, 10000); } - join_attempts++; - } - }); + $.post(window.location.pathname, { join_name: $(".background").attr("join-name") }) } // Refresh the page after 2 mins and attempt to reconnect to ActionCable