mirror of
https://github.com/docmost/docmost.git
synced 2025-11-23 12:01:11 +10:00
refactor: switch to HttpOnly cookie (#660)
* Switch to httpOnly cookie * create endpoint to retrieve temporary collaboration token * cleanups
This commit is contained in:
@ -4,9 +4,11 @@ import { Link, useSearchParams } from "react-router-dom";
|
||||
import { useVerifyUserTokenQuery } from "@/features/auth/queries/auth-query";
|
||||
import { Button, Container, Group, Text } from "@mantine/core";
|
||||
import APP_ROUTE from "@/lib/app-route";
|
||||
import {getAppName} from "@/lib/config.ts";
|
||||
import { getAppName } from "@/lib/config.ts";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function PasswordReset() {
|
||||
const { t } = useTranslation();
|
||||
const [searchParams] = useSearchParams();
|
||||
const { data, isLoading, isError } = useVerifyUserTokenQuery({
|
||||
token: searchParams.get("token"),
|
||||
@ -22,11 +24,13 @@ export default function PasswordReset() {
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>Password Reset - {getAppName()}</title>
|
||||
<title>
|
||||
{t("Password Reset")} - {getAppName()}
|
||||
</title>
|
||||
</Helmet>
|
||||
<Container my={40}>
|
||||
<Text size="lg" ta="center">
|
||||
Invalid or expired password reset link
|
||||
{t("Invalid or expired password reset link")}
|
||||
</Text>
|
||||
<Group justify="center">
|
||||
<Button
|
||||
@ -35,7 +39,7 @@ export default function PasswordReset() {
|
||||
variant="subtle"
|
||||
size="md"
|
||||
>
|
||||
Goto login page
|
||||
{t("Goto login page")}
|
||||
</Button>
|
||||
</Group>
|
||||
</Container>
|
||||
@ -46,7 +50,9 @@ export default function PasswordReset() {
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>Password Reset - {getAppName()}</title>
|
||||
<title>
|
||||
{t("Password Reset")} - {getAppName()}
|
||||
</title>
|
||||
</Helmet>
|
||||
<PasswordResetForm resetToken={resetToken} />
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user