Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

496 B
Raw Blame
import { useAuth } from '@spree/dashboard-core'
import { createFileRoute, Navigate } from '@tanstack/react-router'
import { LoginPage } from '../pages/login'

export const Route = createFileRoute('/login')({
  component: Login,
})

function Login() {
  const { isInitializing, isAuthenticated } = useAuth()
  if (isInitializing) return null
  // A live session landing on /login goes where it was headed instead.
  if (isAuthenticated) return <Navigate to="/" replace />
  return <LoginPage />
}