You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a next JS 14 application, it's integrated with keycloak 25. I'm facing an issue in integrating Keycloak with Next.js 14 applicaiton.
If I'm logging in to my application on one tab, and opening another application on another tab, then that application also logging in.
If i am logging out from my application(Application A), then it's logging out from the other application(Application B) which is also integrated with keycloak25 . If I'm logging out from my application, then the session in keycloak gets removed and from both application it's getting logged out. But when i am logging out from the other application(Application B) and checking my application, it's not logging out in real time. If I'll print the token in my middleware.ts or status from session in SessionHandler.tsx, then it's printing token and status as authenticated.
If I'll logout my session from keycloak manually, that means there is no session active from keycloak side, still, it's active in my applciation.
I'm sharing my implementation with you:
**layout.tsx**
import type { Metadata } from 'next'
import 'bootstrap/dist/css/bootstrap.css'
import { Inter } from 'next/font/google'
import './globals.css'
import SessionProviderWrapper from '@/components/auth_provider_wrapper'
import SessionHandler from '@/components/sessionHandler'
import { Toaster } from 'react-hot-toast'
import CreateUserApi from '@/components/create_user'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: "assessIt",
description: "",
icons: {
icon: "/favicon.ico",
},
}
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<SessionProviderWrapper>
<html lang="en">
<body className={`{inter.className}`}>
<SessionHandler>
<CreateUserApi />
<Toaster position="bottom-center" />
{children}
</SessionHandler>
</body>
</html>
</SessionProviderWrapper>
)
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a next JS 14 application, it's integrated with keycloak 25. I'm facing an issue in integrating Keycloak with Next.js 14 applicaiton.
If I'm logging in to my application on one tab, and opening another application on another tab, then that application also logging in.
If i am logging out from my application(Application A), then it's logging out from the other application(Application B) which is also integrated with keycloak25 . If I'm logging out from my application, then the session in keycloak gets removed and from both application it's getting logged out. But when i am logging out from the other application(Application B) and checking my application, it's not logging out in real time. If I'll print the token in my middleware.ts or status from session in SessionHandler.tsx, then it's printing token and status as authenticated.
If I'll logout my session from keycloak manually, that means there is no session active from keycloak side, still, it's active in my applciation.
I'm sharing my implementation with you:
If anyone have any idea please help me here.
Beta Was this translation helpful? Give feedback.
All reactions