recovered collection, removed "alert" & "back to dashboard"
This commit is contained in:
parent
6101f34bdc
commit
3f96a8203d
@ -1,5 +1,5 @@
|
||||
NEXT_PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
|
||||
NEXT_PUBLIC_APPWRITE_PROJECT_ID=67e1445400053dca1d9b
|
||||
NEXT_PUBLIC_APPWRITE_DATABASE_ID=67e1452b00016444b37f
|
||||
NEXT_PUBLIC_APPWRITE_COLLECTION_ID=67fe4029000f7e0a7b92
|
||||
NEXT_PUBLIC_APPWRITE_USERS_COLLECTION_ID=67ff72bd00370366ae3e
|
||||
NEXT_PUBLIC_APPWRITE_COLLECTION_ID=681c367b0016f9ba0e8e
|
||||
NEXT_PUBLIC_APPWRITE_USERS_COLLECTION_ID=681c35690038f9798152
|
||||
|
@ -6,6 +6,6 @@
|
||||
|
||||
// lib/config.js
|
||||
export const DATABASE_ID = "67e1452b00016444b37f";
|
||||
export const COLLECTION_ID = "67fe4029000f7e0a7b92";
|
||||
export const COLLECTION_ID = "681c367b0016f9ba0e8e";
|
||||
export const SETTINGS_COLLECTION_ID = "settings";
|
||||
export const AVG_CONSULTATION_KEY = "avg_consultation";
|
@ -82,7 +82,7 @@ const createEntries = async () => {
|
||||
}
|
||||
|
||||
setBookings(updatedBookings);
|
||||
alert(`${validBookings.length} tokens created successfully!`);
|
||||
// alert(`${validBookings.length} tokens created successfully!`);
|
||||
} catch (error) {
|
||||
console.error("Creation error:", error);
|
||||
setError(error.message);
|
||||
|
@ -17,16 +17,24 @@ export default function ResetPasswordPage() {
|
||||
const { darkMode, toggleDarkMode } = useTheme();
|
||||
const [email, setEmail] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [message, setMessage] = useState({ text: "", type: "" }); // type can be "success" or "error"
|
||||
|
||||
const handleSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
setLoading(true);
|
||||
setMessage({ text: "", type: "" });
|
||||
try {
|
||||
await account.createRecovery(email, "http://localhost:3000/reset-password");
|
||||
alert("Password reset link sent to your email!");
|
||||
setMessage({
|
||||
text: "Password reset link sent to your email!",
|
||||
type: "success"
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error:", error);
|
||||
alert(`Failed to send reset link: ${error.message}`);
|
||||
setMessage({
|
||||
text: `Failed to send reset link: ${error.message}`,
|
||||
type: "error"
|
||||
});
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@ -53,6 +61,15 @@ export default function ResetPasswordPage() {
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||
Enter your email address linked to your account, and we'll send you a link to reset your password.
|
||||
</p>
|
||||
{message.text && (
|
||||
<div className={`mt-4 p-3 rounded-md ${
|
||||
message.type === "success"
|
||||
? "bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-200"
|
||||
: "bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-200"
|
||||
}`}>
|
||||
{message.text}
|
||||
</div>
|
||||
)}
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div className="space-y-5">
|
||||
<div>
|
||||
@ -85,4 +102,4 @@ export default function ResetPasswordPage() {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
@ -87,7 +87,7 @@ export default function SignInPage() {
|
||||
{/* Left Side - Form */}
|
||||
<div className="w-full flex flex-col justify-center p-6 sm:p-12 lg:p-16">
|
||||
<div className="w-full max-w-md mx-auto">
|
||||
<Link
|
||||
{/* <Link
|
||||
href="/dashboard"
|
||||
className="inline-flex items-center text-sm text-gray-500 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-10"
|
||||
>
|
||||
@ -108,7 +108,7 @@ export default function SignInPage() {
|
||||
/>
|
||||
</svg>
|
||||
Back to dashboard
|
||||
</Link>
|
||||
</Link> */}
|
||||
|
||||
<div className="mb-8">
|
||||
<h1 className="mb-2 text-2xl font-bold text-gray-800 dark:text-white/90 sm:text-3xl">
|
||||
|
@ -86,7 +86,7 @@ export default function SignUpPage() {
|
||||
{/* Form */}
|
||||
<div className="flex flex-col flex-1 w-full">
|
||||
<div className="w-full max-w-md pt-5 mx-auto sm:py-10">
|
||||
<Link
|
||||
{/* <Link
|
||||
href="/dashboard"
|
||||
className="inline-flex items-center text-sm text-gray-500 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
||||
>
|
||||
@ -107,7 +107,7 @@ export default function SignUpPage() {
|
||||
/>
|
||||
</svg>
|
||||
Back to dashboard
|
||||
</Link>
|
||||
</Link> */}
|
||||
</div>
|
||||
<div className="flex flex-col justify-center flex-1 w-full max-w-md mx-auto">
|
||||
<div className="mb-5 sm:mb-8">
|
||||
|
@ -107,7 +107,7 @@ export default function SignUpPage() {
|
||||
{/* Left side - Form */}
|
||||
<div className="lg:w-1/2 w-full flex flex-col items-center justify-center p-4">
|
||||
<div className="w-full max-w-md">
|
||||
<div className="w-full max-w-md pt-5 mx-auto sm:py-10">
|
||||
{/* <div className="w-full max-w-md pt-5 mx-auto sm:py-10">
|
||||
<Link
|
||||
href="/dashboard"
|
||||
className="inline-flex items-center text-sm text-gray-500 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
||||
@ -130,7 +130,7 @@ export default function SignUpPage() {
|
||||
</svg>
|
||||
Back to dashboard
|
||||
</Link>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
<div className="mb-5 sm:mb-8">
|
||||
<h1 className="mb-2 font-semibold text-gray-800 text-title-sm dark:text-white/90 sm:text-title-md">
|
||||
|
Loading…
Reference in New Issue
Block a user