99 lines
3.4 KiB
JavaScript
99 lines
3.4 KiB
JavaScript
import { jsxs, jsx } from "react/jsx-runtime";
|
|
import { useForm, Head } from "@inertiajs/react";
|
|
import classNames from "classnames";
|
|
import { u as useRoute } from "../app.js";
|
|
import { A as AuthenticationCard } from "./AuthenticationCard--MCzdtHR.js";
|
|
import { I as InputLabel } from "./InputLabel-DhqxoV6M.js";
|
|
import { P as PrimaryButton } from "./PrimaryButton-C2B8UWiv.js";
|
|
import { T as TextInput, I as InputError } from "./TextInput-CMJy2hIv.js";
|
|
import "axios";
|
|
import "lodash";
|
|
import "react-dom/client";
|
|
import "react";
|
|
import "./AuthenticationCardLogo-CZgVhhfE.js";
|
|
function ResetPassword({ token, email }) {
|
|
const route = useRoute();
|
|
const form = useForm({
|
|
token,
|
|
email,
|
|
password: "",
|
|
password_confirmation: ""
|
|
});
|
|
function onSubmit(e) {
|
|
e.preventDefault();
|
|
form.post(route("password.update"), {
|
|
onFinish: () => form.reset("password", "password_confirmation")
|
|
});
|
|
}
|
|
return /* @__PURE__ */ jsxs(AuthenticationCard, { children: [
|
|
/* @__PURE__ */ jsx(Head, { title: "Reset Password" }),
|
|
/* @__PURE__ */ jsxs("form", { onSubmit, children: [
|
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
/* @__PURE__ */ jsx(InputLabel, { htmlFor: "email", children: "Email" }),
|
|
/* @__PURE__ */ jsx(
|
|
TextInput,
|
|
{
|
|
id: "email",
|
|
type: "email",
|
|
className: "mt-1 block w-full",
|
|
value: form.data.email,
|
|
onChange: (e) => form.setData("email", e.currentTarget.value),
|
|
required: true,
|
|
autoFocus: true
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsx(InputError, { className: "mt-2", message: form.errors.email })
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
/* @__PURE__ */ jsx(InputLabel, { htmlFor: "password", children: "Password" }),
|
|
/* @__PURE__ */ jsx(
|
|
TextInput,
|
|
{
|
|
id: "password",
|
|
type: "password",
|
|
className: "mt-1 block w-full",
|
|
value: form.data.password,
|
|
onChange: (e) => form.setData("password", e.currentTarget.value),
|
|
required: true,
|
|
autoComplete: "new-password"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsx(InputError, { className: "mt-2", message: form.errors.password })
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
/* @__PURE__ */ jsx(InputLabel, { htmlFor: "password_confirmation", children: "Confirm Password" }),
|
|
/* @__PURE__ */ jsx(
|
|
TextInput,
|
|
{
|
|
id: "password_confirmation",
|
|
type: "password",
|
|
className: "mt-1 block w-full",
|
|
value: form.data.password_confirmation,
|
|
onChange: (e) => form.setData("password_confirmation", e.currentTarget.value),
|
|
required: true,
|
|
autoComplete: "new-password"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsx(
|
|
InputError,
|
|
{
|
|
className: "mt-2",
|
|
message: form.errors.password_confirmation
|
|
}
|
|
)
|
|
] }),
|
|
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-end mt-4", children: /* @__PURE__ */ jsx(
|
|
PrimaryButton,
|
|
{
|
|
className: classNames({ "opacity-25": form.processing }),
|
|
disabled: form.processing,
|
|
children: "Reset Password"
|
|
}
|
|
) })
|
|
] })
|
|
] });
|
|
}
|
|
export {
|
|
ResetPassword as default
|
|
};
|