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.

540 B
Raw Blame
import { useAuth } from '@spree/dashboard-core'
import { createFileRoute, Navigate } from '@tanstack/react-router'
import { ForgotPasswordPage } from '../pages/forgot-password'

export const Route = createFileRoute('/forgot-password')({
  component: ForgotPassword,
})

function ForgotPassword() {
  const { isInitializing, isAuthenticated } = useAuth()
  if (isInitializing) return null
  // Someone already signed in has no use for a reset link.
  if (isAuthenticated) return <Navigate to="/" replace />
  return <ForgotPasswordPage />
}