diff --git a/app/javascript/flavours/glitch/utils/log_out.ts b/app/javascript/flavours/glitch/utils/log_out.ts index a7c7ef5454..d4db471a6e 100644 --- a/app/javascript/flavours/glitch/utils/log_out.ts +++ b/app/javascript/flavours/glitch/utils/log_out.ts @@ -1,5 +1,3 @@ -import Rails from '@rails/ujs'; - import { signOutLink } from 'flavours/glitch/utils/backend_links'; export const logOut = () => { @@ -11,13 +9,18 @@ export const logOut = () => { methodInput.setAttribute('type', 'hidden'); form.appendChild(methodInput); - const csrfToken = Rails.csrfToken(); - const csrfParam = Rails.csrfParam(); + const csrfToken = document.querySelector( + 'meta[name=csrf-token]', + ); + + const csrfParam = document.querySelector( + 'meta[name=csrf-param]', + ); if (csrfParam && csrfToken) { const csrfInput = document.createElement('input'); - csrfInput.setAttribute('name', csrfParam); - csrfInput.setAttribute('value', csrfToken); + csrfInput.setAttribute('name', csrfParam.content); + csrfInput.setAttribute('value', csrfToken.content); csrfInput.setAttribute('type', 'hidden'); form.appendChild(csrfInput); }