SurfSense/surfsense_web/app/auth/callback/page.tsx
Claude d273f499a6
Refactor auth token usage to use AUTH_TOKEN_KEY constant
- Updated all hooks to import and use AUTH_TOKEN_KEY constant from lib/constants
- Updated all components to use AUTH_TOKEN_KEY instead of hardcoded string
- Updated all atoms to use AUTH_TOKEN_KEY
- Updated all app pages to use AUTH_TOKEN_KEY
- Made CORS origin configurable via CORS_ORIGINS environment variable
- Added CORS_ORIGINS to .env.example with documentation

This improves maintainability by centralizing the auth token key string,
preventing typos and making it easier to change the key name if needed.
2025-11-18 22:03:56 +00:00

24 lines
685 B
TypeScript

import { Suspense } from "react";
import TokenHandler from "@/components/TokenHandler";
import { AUTH_TOKEN_KEY } from "@/lib/constants";
export default function AuthCallbackPage() {
return (
<div className="container mx-auto p-4">
<h1 className="text-2xl font-bold mb-4">Authentication Callback</h1>
<Suspense
fallback={
<div className="flex items-center justify-center min-h-[200px]">
<div className="h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"></div>
</div>
}
>
<TokenHandler
redirectPath="/dashboard"
tokenParamName="token"
storageKey={AUTH_TOKEN_KEY}
/>
</Suspense>
</div>
);
}