File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,10 @@ 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 : ( ) => { } ,
@@ -82,6 +79,10 @@ function broadcast() {
8279 }
8380 }
8481
82+ return new BroadcastChannel ( "next-auth" )
83+ }
84+
85+ function broadcast ( ) {
8586 if ( broadcastChannel === null ) {
8687 broadcastChannel = getNewBroadcastChannel ( )
8788 }
@@ -180,7 +181,8 @@ export async function getSession(params?: GetSessionParams) {
180181 params
181182 )
182183 if ( params ?. broadcast ?? true ) {
183- broadcast ( ) . postMessage ( {
184+ // https://github.com/nextauthjs/next-auth/pull/11470
185+ getNewBroadcastChannel ( ) . postMessage ( {
184186 event : "session" ,
185187 data : { trigger : "getSession" } ,
186188 } )
You can’t perform that action at this time.
0 commit comments