File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -67,21 +67,27 @@ export const __NEXTAUTH: AuthClientConfig = {
67
67
_getSession : ( ) => { } ,
68
68
}
69
69
70
+ // https://github.com/nextauthjs/next-auth/pull/10762
70
71
let broadcastChannel : BroadcastChannel | null = null
71
72
72
73
function getNewBroadcastChannel ( ) {
73
- return new BroadcastChannel ( "next-auth" )
74
- }
75
-
76
- function broadcast ( ) {
77
74
if ( typeof BroadcastChannel === "undefined" ) {
78
75
return {
79
76
postMessage : ( ) => { } ,
80
77
addEventListener : ( ) => { } ,
81
78
removeEventListener : ( ) => { } ,
82
- }
79
+ name : "next-auth" ,
80
+ onmessage : null ,
81
+ onmessageerror : null ,
82
+ close : ( ) => { } ,
83
+ dispatchEvent : ( ) => false ,
84
+ } satisfies BroadcastChannel
83
85
}
84
86
87
+ return new BroadcastChannel ( "next-auth" )
88
+ }
89
+
90
+ function broadcast ( ) {
85
91
if ( broadcastChannel === null ) {
86
92
broadcastChannel = getNewBroadcastChannel ( )
87
93
}
@@ -180,8 +186,8 @@ export async function getSession(params?: GetSessionParams) {
180
186
params
181
187
)
182
188
if ( params ?. broadcast ?? true ) {
183
- const broadcastChannel = getNewBroadcastChannel ( )
184
- broadcastChannel . postMessage ( {
189
+ // https://github.com/nextauthjs/next-auth/pull/11470
190
+ getNewBroadcastChannel ( ) . postMessage ( {
185
191
event : "session" ,
186
192
data : { trigger : "getSession" } ,
187
193
} )
You can’t perform that action at this time.
0 commit comments