mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 09:12:08 +01:00
feat: update package dependencies and improve session handling
- Added @tailwindcss/postcss to devDependencies for better PostCSS integration. - Enhanced session import logic in refresh-sessions.ts to ensure proper data mapping and type safety. - Updated postcss.config.js to use the correct plugin name for Tailwind CSS. - Modified tsconfig.json to temporarily disable strict mode and allow implicit any types for smoother development.
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { useState, Suspense } from 'react';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
|
||||
export default function ResetPasswordPage() {
|
||||
// Component that uses useSearchParams wrapped in Suspense
|
||||
function ResetPasswordForm() {
|
||||
const searchParams = useSearchParams();
|
||||
const token = searchParams.get('token');
|
||||
const token = searchParams?.get('token');
|
||||
const [password, setPassword] = useState<string>('');
|
||||
const [message, setMessage] = useState<string>('');
|
||||
const router = useRouter();
|
||||
@ -22,23 +23,36 @@ export default function ResetPasswordPage() {
|
||||
} else setMessage('Invalid or expired link.');
|
||||
}
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
|
||||
<input
|
||||
className="border px-3 py-2 rounded"
|
||||
type="password"
|
||||
placeholder="New Password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
required
|
||||
/>
|
||||
<button className="bg-blue-600 text-white rounded py-2" type="submit">
|
||||
Reset Password
|
||||
</button>
|
||||
<div className="mt-4 text-green-700">{message}</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
// Loading fallback component
|
||||
function LoadingForm() {
|
||||
return <div className="text-center py-4">Loading...</div>;
|
||||
}
|
||||
|
||||
export default function ResetPasswordPage() {
|
||||
return (
|
||||
<div className="max-w-md mx-auto mt-24 bg-white rounded-xl p-8 shadow">
|
||||
<h1 className="text-2xl font-bold mb-6">Reset Password</h1>
|
||||
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
|
||||
<input
|
||||
className="border px-3 py-2 rounded"
|
||||
type="password"
|
||||
placeholder="New Password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
required
|
||||
/>
|
||||
<button className="bg-blue-600 text-white rounded py-2" type="submit">
|
||||
Reset Password
|
||||
</button>
|
||||
</form>
|
||||
<div className="mt-4 text-green-700">{message}</div>
|
||||
<Suspense fallback={<LoadingForm />}>
|
||||
<ResetPasswordForm />
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user