auth fix?
CI/CD Pipeline / Build and Push App Docker Image (push) Successful in 2m55s
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 8s
CI/CD Pipeline / Deploy to Kubernetes (push) Failing after 2m36s

This commit is contained in:
yohlo
2026-07-11 13:11:45 -07:00
parent e67f6b073c
commit ec334bbed4
6 changed files with 32 additions and 15 deletions
+3
View File
@@ -4,6 +4,7 @@ import {
Outlet,
Scripts,
createRootRouteWithContext,
isRedirect,
} from "@tanstack/react-router";
import * as React from "react";
import { DefaultCatchBoundary } from "@/components/DefaultCatchBoundary";
@@ -124,6 +125,8 @@ export const Route = createRootRouteWithContext<{
);
return { auth };
} catch (error: any) {
if (isRedirect(error) || error instanceof Response) throw error;
if (typeof window !== 'undefined') {
const { doesSessionExist, attemptRefreshingSession } = await import('supertokens-web-js/recipe/session');
+9 -2
View File
@@ -29,9 +29,16 @@ function RouteComponent() {
const urlParams = new URLSearchParams(window.location.search);
const redirect = urlParams.get('redirect');
if (redirect && !redirect.includes('_serverFn') && !redirect.includes('/api/')) {
const safe =
redirect &&
redirect.startsWith('/') &&
!redirect.startsWith('/refresh-session') &&
!redirect.includes('_serverFn') &&
!redirect.includes('/api/');
if (safe) {
logger.info("Refresh session route: redirecting to", redirect);
window.location.href = decodeURIComponent(redirect);
window.location.href = redirect;
} else {
logger.info("Refresh session route: redirecting to home");
window.location.href = '/';