File tree Expand file tree Collapse file tree 1 file changed +8
-19
lines changed
packages/laravel-echo/src/connector Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -90,25 +90,14 @@ export abstract class Connector<
9090 * Extract the CSRF token from the page.
9191 */
9292 protected csrfToken ( ) : null | string {
93- let selector ;
94-
95- if ( window ?. Laravel ?. csrfToken ) {
96- return window . Laravel . csrfToken ;
97- }
98-
99- if ( this . options . csrfToken ) {
100- return this . options . csrfToken ;
101- }
102-
103- if (
104- typeof document !== "undefined" &&
105- typeof document . querySelector === "function" &&
106- ( selector = document . querySelector ( 'meta[name="csrf-token"]' ) )
107- ) {
108- return selector . getAttribute ( "content" ) ;
109- }
110-
111- return null ;
93+ return (
94+ window ?. Laravel ?. csrfToken ??
95+ this . options . csrfToken ??
96+ document
97+ ?. querySelector ( 'meta[name="csrf-token"]' )
98+ ?. getAttribute ( "content" ) ??
99+ null
100+ ) ;
112101 }
113102
114103 /**
You can’t perform that action at this time.
0 commit comments