Skip to content

Commit f7935b4

Browse files
authored
Merge branch 'main' into main
2 parents 12c90ab + 0adbd10 commit f7935b4

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

packages/core/src/providers/keycloak.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* @module providers/keycloak
1010
*/
11-
import type { OAuthConfig, OAuthUserConfig } from "./index.js"
11+
import type { OIDCConfig, OIDCUserConfig } from "./index.js"
1212

1313
export interface KeycloakProfile extends Record<string, any> {
1414
exp: number
@@ -99,8 +99,8 @@ export interface KeycloakProfile extends Record<string, any> {
9999
* :::
100100
*/
101101
export 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",

packages/next-auth/src/react.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,27 @@ export const __NEXTAUTH: AuthClientConfig = {
6767
_getSession: () => {},
6868
}
6969

70+
// https://github.com/nextauthjs/next-auth/pull/10762
7071
let broadcastChannel: BroadcastChannel | null = null
7172

7273
function 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
})

0 commit comments

Comments
 (0)