mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
- 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.
24 lines
685 B
TypeScript
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>
|
|
);
|
|
}
|