File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 88 *
99 * @module providers/keycloak
1010 */
11- import type { OAuthConfig , OAuthUserConfig } from "./index.js"
11+ import type { OIDCConfig , OIDCUserConfig } from "./index.js"
1212
1313export interface KeycloakProfile extends Record < string , any > {
1414 exp : number
@@ -99,8 +99,8 @@ export interface KeycloakProfile extends Record<string, any> {
9999 * :::
100100 */
101101export default function Keycloak < P extends KeycloakProfile > (
102- options : OAuthUserConfig < P >
103- ) : OAuthConfig < P > {
102+ options : OIDCUserConfig < P >
103+ ) : OIDCConfig < P > {
104104 return {
105105 id : "keycloak" ,
106106 name : "Keycloak" ,
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