Four controllers each read the csrf-token meta tag themselves. Move the lookup into lib/csrf.js and import it, ahead of the profile image upload controller that also needs it.
4 lines
122 B
JavaScript
4 lines
122 B
JavaScript
export function csrfToken () {
|
|
return document.head.querySelector('meta[name="csrf-token"]')?.getAttribute("content")
|
|
}
|