From 69b97b8fe2938b117a463808902fedaf1f8e5877 Mon Sep 17 00:00:00 2001 From: Mohammad Jalali Date: Wed, 12 Jul 2023 15:28:45 +0330 Subject: [PATCH] authorization of users --- public/images/loading.svg | 1 + public/images/logo.svg | 10 ---------- src/core/components/LoadingHardPage.jsx | 2 +- src/core/components/Messages.jsx | 2 +- src/core/data/apiRoutes.js | 2 +- src/middlewares/WithAuth.jsx | 5 ++--- src/middlewares/WithoutAuth.jsx | 8 ++++---- src/pages/dashboard/index.jsx | 2 +- src/pages/dashboard/loan-follow-up/index.jsx | 2 +- src/pages/dashboard/loan-request/index.jsx | 2 +- 10 files changed, 13 insertions(+), 23 deletions(-) create mode 100644 public/images/loading.svg delete mode 100644 public/images/logo.svg diff --git a/public/images/loading.svg b/public/images/loading.svg new file mode 100644 index 0000000..03b8908 --- /dev/null +++ b/public/images/loading.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/images/logo.svg b/public/images/logo.svg deleted file mode 100644 index 5931dd4..0000000 --- a/public/images/logo.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - MARHABA - - diff --git a/src/core/components/LoadingHardPage.jsx b/src/core/components/LoadingHardPage.jsx index 5da632d..01ce658 100644 --- a/src/core/components/LoadingHardPage.jsx +++ b/src/core/components/LoadingHardPage.jsx @@ -28,7 +28,7 @@ const LoadingHardPage = ({ children, loading }) => { > { { text={ {t( - "typography_your_access_to_this_page_has_expired_Please_login_again" + "Authorization.typography_your_access_to_this_page_has_expired_Please_login_again" )} } @@ -26,8 +26,7 @@ const WithAuthMiddleware = ({ children }) => { variant="contained" component={NextLinkComposed} to={{ - pathname: "/login", - query: { back_url: encodeURIComponent(router.asPath) }, + pathname: "/", }} > {t("login")} diff --git a/src/middlewares/WithoutAuth.jsx b/src/middlewares/WithoutAuth.jsx index 5fb4f93..cb8e571 100644 --- a/src/middlewares/WithoutAuth.jsx +++ b/src/middlewares/WithoutAuth.jsx @@ -37,14 +37,14 @@ const WithoutAuthMiddleware = ({ children }) => { {t( - "typography_your_login_is_valid_and_you_do_not_need_to_login_again" + "Authorization.typography_your_login_is_valid_and_you_do_not_need_to_login_again" )} - {t("typography_redirect_to")}{" "} + {t("Authorization.typography_redirect_to")}{" "} {backUrlDecodedPath - ? t("typography_routing_previuos_page") - : t("typography_routing_dashbaord_page")} + ? t("Authorization.typography_routing_previuos_page") + : t("Authorization.typography_routing_dashbaord_page")} } diff --git a/src/pages/dashboard/index.jsx b/src/pages/dashboard/index.jsx index 806513c..c3c3933 100644 --- a/src/pages/dashboard/index.jsx +++ b/src/pages/dashboard/index.jsx @@ -1,6 +1,6 @@ import DashboardFirstComponent from "@/components/dashboard/first"; import TitlePage from "@/core/components/TitlePage"; -import WithAuthMiddleware from "@/middlewares/WithoutAuth"; +import WithAuthMiddleware from "@/middlewares/WithAuth"; import { parse } from "next-useragent"; export default function Dashboard() { diff --git a/src/pages/dashboard/loan-follow-up/index.jsx b/src/pages/dashboard/loan-follow-up/index.jsx index 46c9440..89a441d 100644 --- a/src/pages/dashboard/loan-follow-up/index.jsx +++ b/src/pages/dashboard/loan-follow-up/index.jsx @@ -1,6 +1,6 @@ import DashboardLoanFollowUpComponent from "@/components/dashboard/loan-follow-up"; import TitlePage from "@/core/components/TitlePage"; -import WithAuthMiddleware from "@/middlewares/WithoutAuth"; +import WithAuthMiddleware from "@/middlewares/WithAuth"; import { parse } from "next-useragent"; export default function LoanFollowUp() { diff --git a/src/pages/dashboard/loan-request/index.jsx b/src/pages/dashboard/loan-request/index.jsx index f66f9fb..962d662 100644 --- a/src/pages/dashboard/loan-request/index.jsx +++ b/src/pages/dashboard/loan-request/index.jsx @@ -1,6 +1,6 @@ import DashboardLoanRequestComponent from "@/components/dashboard/loan-request"; import TitlePage from "@/core/components/TitlePage"; -import WithAuthMiddleware from "@/middlewares/WithoutAuth"; +import WithAuthMiddleware from "@/middlewares/WithAuth"; import { parse } from "next-useragent"; export default function LoanRequest() {