feat(password change): added in password link to email and change in lst

This commit is contained in:
2025-04-23 15:20:35 -05:00
parent 28b050859a
commit 86905b591b
6 changed files with 342 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
import PasswordChange from "@/components/user/PasswordChange";
import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/(user)/passwordChange")({
component: RouteComponent,
beforeLoad: async () => {
const auth = localStorage.getItem("auth_token");
if (!auth) {
throw redirect({
to: "/login",
search: {
// Use the current location to power a redirect after login
// (Do not use `router.state.resolvedLocation` as it can
// potentially lag behind the actual current location)
redirect: location.pathname + location.search,
},
});
}
},
});
function RouteComponent() {
return (
<div>
<PasswordChange />
</div>
);
}