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 = {
6767 _getSession : ( ) => { } ,
6868}
6969
70+ // https://github.com/nextauthjs/next-auth/pull/10762
7071let broadcastChannel : BroadcastChannel | null = null
7172
7273function getNewBroadcastChannel ( ) {
73- return new BroadcastChannel ( "next-auth" )
74- }
75-
76- function broadcast ( ) {
7774 if ( typeof BroadcastChannel === "undefined" ) {
7875 return {
7976 postMessage : ( ) => { } ,
8077 addEventListener : ( ) => { } ,
8178 removeEventListener : ( ) => { } ,
82- }
79+ name : "next-auth" ,
80+ onmessage : null ,
81+ onmessageerror : null ,
82+ close : ( ) => { } ,
83+ dispatchEvent : ( ) => false ,
84+ } satisfies BroadcastChannel
8385 }
8486
87+ return new BroadcastChannel ( "next-auth" )
88+ }
89+
90+ function broadcast ( ) {
8591 if ( broadcastChannel === null ) {
8692 broadcastChannel = getNewBroadcastChannel ( )
8793 }
@@ -180,8 +186,8 @@ export async function getSession(params?: GetSessionParams) {
180186 params
181187 )
182188 if ( params ?. broadcast ?? true ) {
183- const broadcastChannel = getNewBroadcastChannel ( )
184- broadcastChannel . postMessage ( {
189+ // https://github.com/nextauthjs/next-auth/pull/11470
190+ getNewBroadcastChannel ( ) . postMessage ( {
185191 event : "session" ,
186192 data : { trigger : "getSession" } ,
187193 } )
You can’t perform that action at this time.
0 commit comments