diff --git a/web/pages/accounts/reset-password.tsx b/web/pages/accounts/reset-password.tsx
index a5740a731..6591fa131 100644
--- a/web/pages/accounts/reset-password.tsx
+++ b/web/pages/accounts/reset-password.tsx
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
import { useTheme } from "next-themes";
import { Eye, EyeOff } from "lucide-react";
// ui
-import { Button, Input, Spinner } from "@plane/ui";
+import { Button, Input } from "@plane/ui";
// components
import { PasswordStrengthMeter } from "@/components/account";
import { PageHead } from "@/components/core";
@@ -13,8 +13,6 @@ import { PageHead } from "@/components/core";
import { EPageTypes } from "@/helpers/authentication.helper";
import { API_BASE_URL } from "@/helpers/common.helper";
import { getPasswordStrength } from "@/helpers/password.helper";
-// hooks
-import useAuthRedirection from "@/hooks/use-auth-redirection";
// layouts
import DefaultLayout from "@/layouts/default-layout";
// lib
@@ -56,14 +54,6 @@ const ResetPasswordPage: NextPageWithLayout = () => {
const [isPasswordInputFocused, setIsPasswordInputFocused] = useState(false);
// hooks
const { resolvedTheme } = useTheme();
- // store hooks
- //const { captureEvent } = useEventTracker();
- // sign in redirection hook
- const { isRedirecting, handleRedirection } = useAuthRedirection();
-
- useEffect(() => {
- handleRedirection();
- }, [handleRedirection]);
const handleFormChange = (key: keyof TResetPasswordFormValues, value: string) =>
setResetFormData((prev) => ({ ...prev, [key]: value }));
@@ -83,13 +73,6 @@ const ResetPasswordPage: NextPageWithLayout = () => {
[resetFormData]
);
- if (isRedirecting)
- return (
-
-
-
- );
-
return (
diff --git a/web/pages/accounts/set-password.tsx b/web/pages/accounts/set-password.tsx
index 8fc7136e8..09c3eedec 100644
--- a/web/pages/accounts/set-password.tsx
+++ b/web/pages/accounts/set-password.tsx
@@ -2,11 +2,10 @@ import { FormEvent, ReactElement, useEffect, useMemo, useState } from "react";
import { observer } from "mobx-react-lite";
import Image from "next/image";
import { useRouter } from "next/router";
-import useSWR from "swr";
// icons
import { Eye, EyeOff } from "lucide-react";
// ui
-import { Button, Input, Spinner, TOAST_TYPE, setToast } from "@plane/ui";
+import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { PasswordStrengthMeter } from "@/components/account";
import { PageHead } from "@/components/core";
@@ -14,7 +13,6 @@ import { PageHead } from "@/components/core";
import { getPasswordStrength } from "@/helpers/password.helper";
// hooks
import { useUser } from "@/hooks/store";
-import useAuthRedirection from "@/hooks/use-auth-redirection";
// layouts
import { UserAuthWrapper } from "@/layouts/auth-layout";
import DefaultLayout from "@/layouts/default-layout";
@@ -53,19 +51,7 @@ const SetPasswordPage: NextPageWithLayout = observer(() => {
const [csrfToken, setCsrfToken] = useState
(undefined);
const [isPasswordInputFocused, setIsPasswordInputFocused] = useState(false);
- const { data: user, fetchCurrentUser } = useUser();
- // store hooks
- //const { captureEvent } = useEventTracker();
- // sign in redirection hook
- const { isRedirecting, handleRedirection } = useAuthRedirection();
-
- const { isLoading } = useSWR(`CURRENT_USER_DETAILS`, () => fetchCurrentUser(), {
- shouldRetryOnError: false,
- });
-
- useEffect(() => {
- if (user && !user?.is_password_autoset) handleRedirection();
- }, [handleRedirection, user?.is_password_autoset]);
+ const { data: user } = useUser();
useEffect(() => {
if (csrfToken === undefined)
@@ -94,7 +80,6 @@ const SetPasswordPage: NextPageWithLayout = observer(() => {
try {
e.preventDefault();
await handleSetPassword(passwordFormData.password);
- await handleRedirection();
} catch (err: any) {
setToast({
type: TOAST_TYPE.ERROR,
@@ -104,13 +89,6 @@ const SetPasswordPage: NextPageWithLayout = observer(() => {
}
};
- if (isRedirecting || isLoading)
- return (
-
-
-
- );
-
return (
diff --git a/web/pages/accounts/sign-in.tsx b/web/pages/accounts/sign-in.tsx
index 40cad8eff..dc19bde80 100644
--- a/web/pages/accounts/sign-in.tsx
+++ b/web/pages/accounts/sign-in.tsx
@@ -1,10 +1,8 @@
-import { useEffect } from "react";
import { observer } from "mobx-react";
import Image from "next/image";
import Link from "next/link";
// ui
import { useTheme } from "next-themes";
-import { Spinner } from "@plane/ui";
// components
import { SignInAuthRoot } from "@/components/account";
import { PageHead } from "@/components/core";
@@ -13,8 +11,7 @@ import { NAVIGATE_TO_SIGNUP } from "@/constants/event-tracker";
// helpers
import { EPageTypes } from "@/helpers/authentication.helper";
// hooks
-import { useEventTracker, useInstance, useUser } from "@/hooks/store";
-import useAuthRedirection from "@/hooks/use-auth-redirection";
+import { useEventTracker } from "@/hooks/store";
// layouts
import DefaultLayout from "@/layouts/default-layout";
// types
@@ -30,24 +27,9 @@ export type AuthType = "sign-in" | "sign-up";
const SignInPage: NextPageWithLayout = observer(() => {
// store hooks
- const { instance } = useInstance();
- const { data: currentUser } = useUser();
const { captureEvent } = useEventTracker();
// hooks
const { resolvedTheme } = useTheme();
- // login redirection hook
- const { isRedirecting, handleRedirection } = useAuthRedirection();
-
- useEffect(() => {
- handleRedirection();
- }, [handleRedirection]);
-
- if (isRedirecting || currentUser || !instance?.config)
- return (
-
-
-
- );
return (