Prettier format pending files
This commit is contained in:
parent
13c04f8b2e
commit
8fc012ee9c
1 changed files with 32 additions and 8 deletions
|
|
@ -25,13 +25,20 @@ export default function ResetPassword() {
|
||||||
const [resetEmail, setResetEmail] = useState("");
|
const [resetEmail, setResetEmail] = useState("");
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { updatePassword, requestPasswordReset } = useAuth();
|
const { updatePassword, requestPasswordReset } = useAuth();
|
||||||
const { error: toastError, success: toastSuccess, info: toastInfo } = useAethexToast();
|
const {
|
||||||
|
error: toastError,
|
||||||
|
success: toastSuccess,
|
||||||
|
info: toastInfo,
|
||||||
|
} = useAethexToast();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let mounted = true;
|
let mounted = true;
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const hash = typeof window !== "undefined" ? window.location.hash.replace(/^#/, "") : "";
|
const hash =
|
||||||
|
typeof window !== "undefined"
|
||||||
|
? window.location.hash.replace(/^#/, "")
|
||||||
|
: "";
|
||||||
const params = new URLSearchParams(hash);
|
const params = new URLSearchParams(hash);
|
||||||
const urlError = params.get("error");
|
const urlError = params.get("error");
|
||||||
const urlErrorDesc = params.get("error_description");
|
const urlErrorDesc = params.get("error_description");
|
||||||
|
|
@ -111,14 +118,19 @@ export default function ResetPassword() {
|
||||||
{linkError ? (
|
{linkError ? (
|
||||||
<Card className="bg-card/50 backdrop-blur-sm border border-border/50 shadow-2xl">
|
<Card className="bg-card/50 backdrop-blur-sm border border-border/50 shadow-2xl">
|
||||||
<CardHeader className="text-center space-y-2">
|
<CardHeader className="text-center space-y-2">
|
||||||
<CardTitle className="text-2xl text-gradient-purple">Reset link expired</CardTitle>
|
<CardTitle className="text-2xl text-gradient-purple">
|
||||||
|
Reset link expired
|
||||||
|
</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
{linkError || "The link is invalid or has expired. Request a new reset link."}
|
{linkError ||
|
||||||
|
"The link is invalid or has expired. Request a new reset link."}
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<Label htmlFor="resetEmail" className="text-sm font-medium">Email Address</Label>
|
<Label htmlFor="resetEmail" className="text-sm font-medium">
|
||||||
|
Email Address
|
||||||
|
</Label>
|
||||||
<Input
|
<Input
|
||||||
id="resetEmail"
|
id="resetEmail"
|
||||||
type="email"
|
type="email"
|
||||||
|
|
@ -127,11 +139,19 @@ export default function ResetPassword() {
|
||||||
placeholder="you@example.com"
|
placeholder="you@example.com"
|
||||||
/>
|
/>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Button variant="outline" onClick={() => navigate("/login")}>Back to login</Button>
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
onClick={() => navigate("/login")}
|
||||||
|
>
|
||||||
|
Back to login
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (!resetEmail) {
|
if (!resetEmail) {
|
||||||
toastInfo({ title: "Enter your email", description: "We will send a fresh reset link." });
|
toastInfo({
|
||||||
|
title: "Enter your email",
|
||||||
|
description: "We will send a fresh reset link.",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
@ -186,7 +206,11 @@ export default function ResetPassword() {
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Button type="submit" className="w-full" disabled={submitting}>
|
<Button
|
||||||
|
type="submit"
|
||||||
|
className="w-full"
|
||||||
|
disabled={submitting}
|
||||||
|
>
|
||||||
{submitting ? "Updating..." : "Update Password"}
|
{submitting ? "Updating..." : "Update Password"}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue