Refactor route protection by replacing ProtectedRoute with ClientRouteGuard in analytics, create-shorturl, and links pages to standardize authentication handling across the application.

This commit is contained in:
2025-04-24 01:41:44 +08:00
parent d80d5e976b
commit 3162836e91
4 changed files with 67 additions and 10 deletions

View File

@@ -3,10 +3,10 @@
import { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/lib/auth';
import { ProtectedRoute } from '@/lib/auth';
import { limqRequest } from '@/lib/api';
import { TeamSelector } from '@/app/components/ui/TeamSelector';
import { ProjectSelector } from '@/app/components/ui/ProjectSelector';
import ClientRouteGuard from '@/app/components/ClientRouteGuard';
interface ShortUrlData {
originalUrl: string;
@@ -21,9 +21,9 @@ interface ShortUrlData {
export default function CreateShortUrlPage() {
return (
<ProtectedRoute>
<ClientRouteGuard>
<CreateShortUrlForm />
</ProtectedRoute>
</ClientRouteGuard>
);
}