π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-1802] chore: remove redirection logic from security settings page if the user password is not setup. (#4992)
Prateek Shourya6e379b93b474
diff --git a/web/app/profile/security/page.tsx b/web/app/profile/security/page.tsxindex e1de5ef1f1..594816cc16 100644--- a/web/app/profile/security/page.tsx+++ b/web/app/profile/security/page.tsx@@ -1,6 +1,6 @@"use client";-import { useEffect, useState } from "react";+import { useState } from "react";import { observer } from "mobx-react";import { Controller, useForm } from "react-hook-form";import { Eye, EyeOff } from "lucide-react";@@ -8,15 +8,11 @@ import { Eye, EyeOff } from "lucide-react";import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui";// componentsimport { PasswordStrengthMeter } from "@/components/account";-import { LogoSpinner } from "@/components/common";import { PageHead } from "@/components/core";import { ProfileSettingContentHeader, ProfileSettingContentWrapper } from "@/components/profile";// helpersimport { authErrorHandler } from "@/helpers/authentication.helper";import { E_PASSWORD_STRENGTH, getPasswordStrength } from "@/helpers/password.helper";-// hooks-import { useUser } from "@/hooks/store";-import { useAppRouter } from "@/hooks/use-app-router";// servicesimport { AuthService } from "@/services/auth.service";import { UserService } from "@/services/user.service";@@ -44,13 +40,9 @@ const defaultShowPassword = {const SecurityPage = observer(() => {// states- const [isPageLoading, setIsPageLoading] = useState(true);const [showPassword, setShowPassword] = useState(defaultShowPassword);const [isPasswordInputFocused, setIsPasswordInputFocused] = useState(false);const [isRetryPasswordInputFocused, setIsRetryPasswordInputFocused] = useState(false);- // router- const router = useAppRouter();- const { data: currentUser } = useUser();// use formconst {control,@@ -98,14 +90,6 @@ const SecurityPage = observer(() => {}};- // if the user doesn't have a password set, redirect to the profile page- useEffect(() => {- if (!currentUser) return;-- if (currentUser.is_password_autoset) router.push("/profile");- else setIsPageLoading(false);- }, [currentUser, router]);-const isButtonDisabled =getPasswordStrength(password) != E_PASSWORD_STRENGTH.STRENGTH_VALID ||oldPassword.trim() === "" ||@@ -119,13 +103,6 @@ const SecurityPage = observer(() => {<PasswordStrengthMeter password={password} isFocused={isPasswordInputFocused} />);- if (isPageLoading)- return (- <div className="grid h-screen w-full place-items-center">- <LogoSpinner />- </div>- );-const renderPasswordMatchError = !isRetryPasswordInputFocused || confirmPassword.length >= password.length;return (