Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor fix

Daniel01a85791583c
diff --git a/components/Modal/User/ChangePassword.tsx b/components/Modal/User/ChangePassword.tsx
index 62372916..09e0f3bf 100644
--- a/components/Modal/User/ChangePassword.tsx
+++ b/components/Modal/User/ChangePassword.tsx
@@ -1,7 +1,7 @@
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { AccountSettings } from "@/types/global";
import useAccountStore from "@/store/account";
-import { useSession } from "next-auth/react";
+import { signOut, useSession } from "next-auth/react";
import { faPenToSquare } from "@fortawesome/free-regular-svg-icons";
import SubmitButton from "@/components/SubmitButton";
import { toast } from "react-hot-toast";
@@ -50,22 +50,24 @@ export default function ChangePassword({
if (response.ok) {
toast.success("Settings Applied!");
- togglePasswordFormModal();
- } else toast.error(response.data as string);
- setSubmitLoader(false);
+ if (
+ user.username !== account.username ||
+ user.name !== account.name ||
+ user.email !== account.email
+ ) {
+ update({
+ username: user.username,
+ email: user.username,
+ name: user.name,
+ });
- if (
- (user.username !== account.username || user.name !== account.name) &&
- user.username &&
- user.email
- )
- update({ username: user.username, name: user.name });
+ signOut();
+ }
- if (response.ok) {
setUser({ ...user, newPassword: undefined });
togglePasswordFormModal();
- }
+ } else toast.error(response.data as string);
} else {
toast.error("Passwords do not match.");
}
diff --git a/components/Modal/User/ProfileSettings.tsx b/components/Modal/User/ProfileSettings.tsx
index 3db24b6e..50908463 100644
--- a/components/Modal/User/ProfileSettings.tsx
+++ b/components/Modal/User/ProfileSettings.tsx
@@ -77,7 +77,6 @@ export default function ProfileSettings({
if (response.ok) {
toast.success("Settings Applied!");
- toggleSettingsModal();
if (
user.username !== account.username ||