forked from External/greenlight
Changed room joining post to hopefully fix CSRF errors (#2027)
This commit is contained in:
parent
6dea54ccd7
commit
b23715c906
|
@ -52,22 +52,7 @@ $(document).on("turbolinks:load", function(){
|
||||||
var join_attempts = 0;
|
var join_attempts = 0;
|
||||||
|
|
||||||
var request_to_join_meeting = function(){
|
var request_to_join_meeting = function(){
|
||||||
$.ajax({
|
$.post(window.location.pathname, { join_name: $(".background").attr("join-name") })
|
||||||
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++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh the page after 2 mins and attempt to reconnect to ActionCable
|
// Refresh the page after 2 mins and attempt to reconnect to ActionCable
|
||||||
|
|
Loading…
Reference in New Issue