This is an automated email from the ASF dual-hosted git repository.

bzp2010 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new a6fc49b  fix: login repeat 2 times (#2179)
a6fc49b is described below

commit a6fc49bcb6b7dfaf11f58fbf64b02875fe1e410d
Author: bzp2010 <[email protected]>
AuthorDate: Wed Oct 20 05:08:14 2021 -0500

    fix: login repeat 2 times (#2179)
---
 web/src/pages/User/Login.tsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/web/src/pages/User/Login.tsx b/web/src/pages/User/Login.tsx
index e3c05ef..7a4427c 100644
--- a/web/src/pages/User/Login.tsx
+++ b/web/src/pages/User/Login.tsx
@@ -57,8 +57,16 @@ const Page: React.FC = () => {
               description: response.message,
               duration: 1,
               onClose: () => {
-                const redirect = getUrlQuery('redirect');
-                history.replace(redirect ? decodeURIComponent(redirect) : '/');
+                let redirect = getUrlQuery('redirect');
+                if (redirect) {
+                  redirect = decodeURIComponent(redirect);
+                  if (redirect === '/user/logout') {
+                    redirect = '/';
+                  }
+                } else {
+                  redirect = '/';
+                }
+                history.replace(redirect);
               },
             });
           }

Reply via email to