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<
90
90
* Extract the CSRF token from the page.
91
91
*/
92
92
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
+ ) ;
112
101
}
113
102
114
103
/**
You can’t perform that action at this time.
0 commit comments