From 41e915ae9059ecbc8069b38554df1a4f73844161 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Aug 2019 15:03:32 -0500 Subject: [PATCH 1/3] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index c658417aa..0c182633b 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -

+

Build Status From b84bcc6446d6fb7515082824679f63c701c269fa Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Aug 2019 15:04:04 -0500 Subject: [PATCH 2/3] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 0c182633b..f95b2ec92 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -

+

Build Status From aa74fcb38f9f318159657ba5050eda62ec043b11 Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Wed, 21 Aug 2019 22:47:43 +1000 Subject: [PATCH 3/3] Remove manual adding of X-CSRF-TOKEN header (#5083) This is unnessecery code because Axios already automatically adds a X-XSRF-TOKEN header from the XSRF-TOKEN cookie encrypted value on same-origin requests. The `VerifyCsrfToken` middleware and Passport's `TokenGuard` already allow using the `X-XSRF-TOKEN` header. --- resources/js/bootstrap.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 7b579cb01..8eaba1b97 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -23,20 +23,6 @@ window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; -/** - * Next we will register the CSRF Token as a common header with Axios so that - * all outgoing HTTP requests automatically have it attached. This is just - * a simple convenience so we don't have to attach every token manually. - */ - -let token = document.head.querySelector('meta[name="csrf-token"]'); - -if (token) { - window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; -} else { - console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); -} - /** * Echo exposes an expressive API for subscribing to channels and listening * for events that are broadcast by Laravel. Echo and event broadcasting