feat(password change): added in password link to email and change in lst
This commit is contained in:
28
frontend/src/routes/(user)/passwordChange.tsx
Normal file
28
frontend/src/routes/(user)/passwordChange.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
@@ -80,8 +80,12 @@ export const Route = createRootRoute({
|
||||
Hello {user?.username}
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
{/* <DropdownMenuItem>Profile</DropdownMenuItem>
|
||||
<DropdownMenuItem>Billing</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
<Link to="/passwordChange">
|
||||
Password Change
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
{/* <DropdownMenuItem>Billing</DropdownMenuItem>
|
||||
<DropdownMenuItem>Team</DropdownMenuItem>
|
||||
<DropdownMenuItem>Subscription</DropdownMenuItem> */}
|
||||
<hr className="solid"></hr>
|
||||
|
||||
106
frontend/src/routes/register.tsx
Normal file
106
frontend/src/routes/register.tsx
Normal file
@@ -0,0 +1,106 @@
|
||||
import RegisterForm from "@/components/auth/Register";
|
||||
import { LstCard } from "@/components/extendedUI/LstCard";
|
||||
import { CardContent, CardHeader } from "@/components/ui/card";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/register")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: () => {
|
||||
const isLoggedIn = localStorage.getItem("auth_token");
|
||||
if (isLoggedIn) {
|
||||
throw redirect({
|
||||
to: "/",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="flex flex-row w-5/6 justify-between gap-2">
|
||||
<RegisterForm />
|
||||
<div>
|
||||
<LstCard>
|
||||
<CardHeader>
|
||||
<h2 className="text-2xl font-bold mb-4">
|
||||
Disclaimer and User Agreement
|
||||
</h2>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="max-w-2xl mx-auto p-6 rounded-2xl shadow-md">
|
||||
<ul className="list-decimal list-inside space-y-3">
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
Authentication Notice:
|
||||
</span>
|
||||
To interact with the Alpla prod through this
|
||||
application, you must use your{" "}
|
||||
<span className="font-semibold">
|
||||
Windows login credentials
|
||||
</span>
|
||||
. These credentials are used solely for
|
||||
authentication purposes.
|
||||
</li>
|
||||
{/* <li>
|
||||
<span className="font-bold">
|
||||
Password Privacy and Security:
|
||||
</span>
|
||||
This application{" "}
|
||||
<span className="font-semibold">
|
||||
does not store, sync, or transmit
|
||||
</span>{" "}
|
||||
your Windows password in any form.
|
||||
Authentication is handled securely, and your
|
||||
credentials are never logged or accessible
|
||||
to the developers or third parties.
|
||||
</li> */}
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
Data Handling:
|
||||
</span>
|
||||
All data accessed through the Alpla prod
|
||||
remains the property of Alpla. The app
|
||||
functions as a secure interface for
|
||||
accessing and updating this information
|
||||
where permitted by your role.
|
||||
</li>
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
User Responsibility:
|
||||
</span>
|
||||
You are responsible for any actions
|
||||
performed using your account. Please ensure
|
||||
you do not share your credentials with
|
||||
others and always log out of the application
|
||||
when not in use.
|
||||
</li>
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
No Warranty:
|
||||
</span>
|
||||
This application is provided "
|
||||
<span className="italic">as is</span>"
|
||||
without any warranty of any kind, either
|
||||
expressed or implied. While every effort is
|
||||
made to ensure functionality and data
|
||||
accuracy, the app is subject to ongoing
|
||||
development and may contain bugs or require
|
||||
updates.
|
||||
</li>
|
||||
<li>
|
||||
<span className="font-bold">
|
||||
Consent Required:
|
||||
</span>
|
||||
By signing up or continuing to use this
|
||||
application, you agree to the above terms
|
||||
and acknowledge that you understand how your
|
||||
login information is used.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</CardContent>
|
||||
</LstCard>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user