KindeK
Kinde12mo ago
33 replies
__maxom__

Kinde Error:

Something went wrong when we tried to authenticate you, and we can’t offer a quick way out. Start a new session and try signing in again. Error code: 1656

Code reference:

import { createFileRoute, Outlet } from "@tanstack/react-router";

import { SidebarProvider } from "@/components/ui/sidebar";
import { AppSidebar } from "@/components/sidebars/app-sidebar";
import { SiteHeader } from "@/components/header/site-header";

export const Route = createFileRoute("/_app-layout")({
beforeLoad: ({ context, location }) => {
if (!context.auth.isAuthenticated) {
console.log("Not authenticated, location: ", location.pathname);
// Redirect manually using window.location
window.location.href = https://<domain>.kinde.com/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A5173&client_id=<client-id>>&response_type=code&scope=openid+profile+email+offline&code_challenge=TX0W79xv40MuaJ1DNZFNEK25nKIH2VvS2ypjsYFzD3U&code_challenge_method=S256&state=7edbee716bd9c12fd3ca0a839b1a7f6b4b2f8827fcaa0764bccf53c2;
}
},
component: AppLayoutComponent,
});

function AppLayoutComponent() {
return (
<div className="[--header-height:calc(theme(spacing.14))]">
<SidebarProvider className="flex flex-col">
<SiteHeader />
<div className="flex flex-1">
<AppSidebar />
<Outlet />
</div>
</SidebarProvider>
</div>
);
}
Was this page helpful?