From f7bdac1e8c6385885793a84c3640b57ebe97735d Mon Sep 17 00:00:00 2001 From: Shafin Al Karim <129021108+shafin-deriv@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:35:26 +0800 Subject: [PATCH] Revert "feat: oidc implementation" --- package-lock.json | 26 ++++++------- package.json | 2 +- .../UserNavbarItem/item.desktop.tsx | 39 +------------------ .../Apiexplorer/LoginDialog/index.tsx | 7 +--- src/features/Callback/CallbackPage.tsx | 22 ----------- src/features/Callback/index.ts | 3 -- src/features/Login/Login.tsx | 8 +--- .../dashboard/__tests__/dashboard.test.tsx | 6 --- src/features/dashboard/dashboard.tsx | 3 +- src/hooks/useHandleLogin/index.tsx | 39 ------------------- .../useLogout/__tests__/useLogout.test.tsx | 16 -------- src/hooks/useLogout/index.tsx | 13 ++++--- src/pages/auth.tsx | 5 +-- src/pages/callback.tsx | 30 -------------- src/utils/__tests__/utils.test.ts | 32 --------------- src/utils/index.ts | 29 ++------------ 16 files changed, 31 insertions(+), 249 deletions(-) delete mode 100644 src/features/Callback/CallbackPage.tsx delete mode 100644 src/features/Callback/index.ts delete mode 100644 src/hooks/useHandleLogin/index.tsx delete mode 100644 src/pages/callback.tsx diff --git a/package-lock.json b/package-lock.json index dd7cd2af6..5d70b9391 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@deriv-com/analytics": "^1.22.1", - "@deriv-com/auth-client": "^1.3.1", + "@deriv-com/auth-client": "^1.0.29", "@deriv-com/quill-ui": "^1.16.21", "@deriv/deriv-api": "^1.0.11", "@deriv/ui": "^0.8.0", @@ -2599,16 +2599,12 @@ } }, "node_modules/@deriv-com/auth-client": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@deriv-com/auth-client/-/auth-client-1.3.1.tgz", - "integrity": "sha512-rS57tiQqogYPHnpGHM+1d6V8U0cUzmpD/fcK1A6jbeG9lr8Ntr6KYMOm07XOutG1P7joU/ppeR3Jpgn3SDzT/A==", + "version": "1.0.29", + "resolved": "https://registry.npmjs.org/@deriv-com/auth-client/-/auth-client-1.0.29.tgz", + "integrity": "sha512-4iBxaSKM9hu6qVHGUr4MHtik59j1ZIuvveRnSqAbqQgcQGzKfSLRwGJ53P/5lVByh9fIIyICpuxbTgaaYA4eXg==", "dependencies": { - "@deriv-com/utils": "^0.0.42", - "js-cookie": "3.0.5", + "@deriv-com/utils": "^0.0.37", "oidc-client-ts": "^3.1.0" - }, - "optionalDependencies": { - "@rollup/rollup-linux-x64-gnu": "^4.27.3" } }, "node_modules/@deriv-com/quill-tokens": { @@ -2692,9 +2688,9 @@ } }, "node_modules/@deriv-com/utils": { - "version": "0.0.42", - "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.42.tgz", - "integrity": "sha512-4JhTpg0sQWCq94RSMGpuT/09bYSV8yO3WdunM2R84qxWNitRH/i4k/xfdleRVzX+xLSmMmJWlkbD6NAlP8U5eg==" + "version": "0.0.37", + "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.37.tgz", + "integrity": "sha512-+ngUvT+OqwblBoqkHcsbLtljjwOGIjjMpo5xLS5fwyhtNvBe8Rcq+140QV1j0xq9vlm2kmcowEKIVBq33imFmg==" }, "node_modules/@deriv/api-types": { "version": "1.0.292", @@ -6476,9 +6472,9 @@ } }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.0.tgz", - "integrity": "sha512-Nl4KIzteVEKE9BdAvYoTkW19pa7LR/RBrT6F1dJCV/3pbjwDcaOq+edkP0LXuJ9kflW/xOK414X78r+K84+msw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", + "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 69e899f7b..0bb7d5a6a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "dependencies": { "@deriv-com/quill-ui": "^1.16.21", "@deriv-com/analytics": "^1.22.1", - "@deriv-com/auth-client": "^1.3.1", + "@deriv-com/auth-client": "^1.0.29", "@deriv/deriv-api": "^1.0.11", "@radix-ui/react-tooltip": "^1.0.7", "@react-spring/web": "^9.7.3", diff --git a/src/components/UserNavbarItem/item.desktop.tsx b/src/components/UserNavbarItem/item.desktop.tsx index c6f7180e8..7bbd9594d 100644 --- a/src/components/UserNavbarItem/item.desktop.tsx +++ b/src/components/UserNavbarItem/item.desktop.tsx @@ -12,8 +12,6 @@ import useDeviceType from '@site/src/hooks/useDeviceType'; import { IUserNavbarItemProps } from './item.types'; import styles from './UserNavbarItem.module.scss'; -import { useHandleLogin } from '@site/src/hooks/useHandleLogin'; -import Cookies from 'js-cookie'; interface IActionProps { handleClick: () => void; @@ -64,16 +62,12 @@ const DashboardActions: React.FC = ({ handleClick, isDesktop }) => const SignedInActions: React.FC = ({ handleClick, isDesktop }) => { const signedInButtonClasses = clsx('navbar__item', styles.UserNavbarItem, styles.SignedInButton); - const { handleLogin } = useHandleLogin({ - onClickLogin: handleClick, - }); - return (