1
0
forked from maik/IPFS-portal

SIWE auth, API proxy fixes, dashboard, login, usage pages

- SIWE auth flow: challenge/login/logout/me API routes + JWT middleware
- Fixed [...path] catch-all: Kubo proxy with matchRoute() + mapToKuboAPI()
- Fixed session_id → nonce field mismatch in AuthProvider
- Fixed dashboard pins crash: Kubo returns {Keys: {...}}, not array
- Added middleware route guard (307 redirect to /login)
- Added login, register, profile, usage, upload pages
- Added dashboard components (StorageGauge, FreeTierProgress)
- Added SWR hooks + AuthGuard + Providers + Toast/ErrorBoundary
- Added payment integration (smart contract ABI, tiers, tokens)
- Fixed IPNS key listing: Name/Id → name/id mapping
- Added PWA support (manifest, service worker, icons)
- Added tests for helpers, limits, search-index, wallet
This commit is contained in:
maikrolf
2026-06-28 18:31:05 +02:00
parent 1ddc89479c
commit c9432a16ba
84 changed files with 6679 additions and 1426 deletions
+19 -6
View File
@@ -2,9 +2,11 @@
import { useEffect, useState } from 'react';
import { checkHealth } from '@/lib/api';
import { Shield } from 'lucide-react';
import { useAuth } from '@/lib/auth';
import { Shield, LogOut } from 'lucide-react';
export default function PortalHeader() {
const { user, logout } = useAuth();
const [nodeStatus, setNodeStatus] = useState<'online' | 'offline' | 'checking'>('checking');
const [nodeVersion, setNodeVersion] = useState('');
@@ -43,11 +45,22 @@ export default function PortalHeader() {
</span>
</div>
{/* Wallet badge placeholder */}
<div className="flex items-center gap-2 px-3 py-1.5 rounded-lg glass text-xs text-surface-300">
<Shield className="w-3.5 h-3.5 text-accent-cyan" />
Wallet Connected
</div>
{/* Wallet badge */}
{user && (
<div className="flex items-center gap-2 pl-3 pr-2 py-1.5 rounded-lg bg-surface-800/50 text-xs">
<Shield className="w-3.5 h-3.5 text-accent-cyan" />
<span className="text-surface-300 font-mono">
{user.address.slice(0, 6)}...{user.address.slice(-4)}
</span>
<button
onClick={logout}
className="ml-1 p-1 rounded-md hover:bg-surface-700 text-surface-500 hover:text-accent-rose transition-colors"
title="Uitloggen"
>
<LogOut className="w-3 h-3" />
</button>
</div>
)}
</div>
</header>
);