fix: login with revalidate path and wrong preferences link (#654)
This commit is contained in:
@@ -12,6 +12,8 @@ import { useScopedI18n } from "@homarr/translation/client";
|
|||||||
import type { z } from "@homarr/validation";
|
import type { z } from "@homarr/validation";
|
||||||
import { validation } from "@homarr/validation";
|
import { validation } from "@homarr/validation";
|
||||||
|
|
||||||
|
import { revalidatePathActionAsync } from "~/app/revalidatePathAction";
|
||||||
|
|
||||||
export const LoginForm = () => {
|
export const LoginForm = () => {
|
||||||
const t = useScopedI18n("user");
|
const t = useScopedI18n("user");
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -32,7 +34,7 @@ export const LoginForm = () => {
|
|||||||
redirect: false,
|
redirect: false,
|
||||||
callbackUrl: "/",
|
callbackUrl: "/",
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then(async (response) => {
|
||||||
if (!response?.ok || response.error) {
|
if (!response?.ok || response.error) {
|
||||||
throw response?.error;
|
throw response?.error;
|
||||||
}
|
}
|
||||||
@@ -41,6 +43,7 @@ export const LoginForm = () => {
|
|||||||
title: t("action.login.notification.success.title"),
|
title: t("action.login.notification.success.title"),
|
||||||
message: t("action.login.notification.success.message"),
|
message: t("action.login.notification.success.message"),
|
||||||
});
|
});
|
||||||
|
await revalidatePathActionAsync("/");
|
||||||
router.push("/");
|
router.push("/");
|
||||||
})
|
})
|
||||||
.catch((error: Error | string) => {
|
.catch((error: Error | string) => {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export const UserAvatarMenu = ({ children }: UserAvatarMenuProps) => {
|
|||||||
<>
|
<>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
component={Link}
|
component={Link}
|
||||||
href={`/manage/users/${session.data?.user.id}`}
|
href={`/manage/users/${session.data?.user.id}/general`}
|
||||||
leftSection={<IconSettings size="1rem" />}
|
leftSection={<IconSettings size="1rem" />}
|
||||||
>
|
>
|
||||||
{t("preferences")}
|
{t("preferences")}
|
||||||
|
|||||||
Reference in New Issue
Block a user