mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #949 from 190km/fix-edit-password
fix(settings/profile): edit profile password fixed
This commit is contained in:
@@ -104,6 +104,7 @@ export const ProfileForm = () => {
|
|||||||
.then(async () => {
|
.then(async () => {
|
||||||
await refetch();
|
await refetch();
|
||||||
toast.success("Profile Updated");
|
toast.success("Profile Updated");
|
||||||
|
form.reset();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
toast.error("Error to Update the profile");
|
toast.error("Error to Update the profile");
|
||||||
|
|||||||
@@ -188,9 +188,9 @@ export const authRouter = createTRPCRouter({
|
|||||||
.mutation(async ({ ctx, input }) => {
|
.mutation(async ({ ctx, input }) => {
|
||||||
const currentAuth = await findAuthByEmail(ctx.user.email);
|
const currentAuth = await findAuthByEmail(ctx.user.email);
|
||||||
|
|
||||||
if (input.password) {
|
if (input.currentPassword || input.password) {
|
||||||
const correctPassword = bcrypt.compareSync(
|
const correctPassword = bcrypt.compareSync(
|
||||||
input.password,
|
input.currentPassword || "",
|
||||||
currentAuth?.password || "",
|
currentAuth?.password || "",
|
||||||
);
|
);
|
||||||
if (!correctPassword) {
|
if (!correctPassword) {
|
||||||
|
|||||||
Reference in New Issue
Block a user