Merged in fix/tracking-issue (pull request #1643)

Fix/tracking issue: add try/catch around promises

* Test

* Cleaning


Approved-by: Anton Gunnarsson
This commit is contained in:
Linus Flood
2025-03-26 12:59:59 +00:00
parent ca23589f88
commit ddefe2e59b
2 changed files with 16 additions and 5 deletions
@@ -7,6 +7,7 @@ import { getProfile } from "@/lib/trpc/memoizedRequests"
import { auth } from "@/auth"
import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
import { isValidSession } from "@/utils/session"
export async function ProtectedLayout({ children }: React.PropsWithChildren) {
const intl = await getIntl()
@@ -22,7 +23,7 @@ export async function ProtectedLayout({ children }: React.PropsWithChildren) {
const redirectURL = `/${getLang()}/login?redirectTo=${redirectTo}`
if (!session) {
if (!isValidSession(session)) {
console.log(`[layout:protected] no session, redirecting to: ${redirectURL}`)
redirect(redirectURL)
}