bzp2010 commented on a change in pull request #330:
URL: https://github.com/apache/apisix-dashboard/pull/330#discussion_r474585352



##########
File path: src/pages/User/Logout.tsx
##########
@@ -0,0 +1,28 @@
+import React from 'react';
+import LoginMethodPassword from '@/pages/User/components/LoginMethodPassword';
+import LoginMethodExample from '@/pages/User/components/LoginMethodExample';
+import { UserModule } from '@/pages/User/typing';
+import { getUrlQuery } from '@/helpers';
+
+/**
+ * Login Methods List
+ */
+const loginMethods: UserModule.LoginMethod[] = [LoginMethodPassword, 
LoginMethodExample];
+
+/**
+ * User Logout Page
+ * @constructor
+ */
+const Page: React.FC = () => {
+  // run all logout method
+  loginMethods.forEach((item) => {
+    item.logout();
+  });
+
+  const redirect = getUrlQuery('redirect');
+  window.location.href = `/user/login${redirect ? `?redirect=${redirect}` : 
''}`;
+
+  return <div />;

Review comment:
       return null now

##########
File path: src/pages/User/Logout.tsx
##########
@@ -0,0 +1,28 @@
+import React from 'react';
+import LoginMethodPassword from '@/pages/User/components/LoginMethodPassword';
+import LoginMethodExample from '@/pages/User/components/LoginMethodExample';
+import { UserModule } from '@/pages/User/typing';
+import { getUrlQuery } from '@/helpers';
+
+/**
+ * Login Methods List
+ */
+const loginMethods: UserModule.LoginMethod[] = [LoginMethodPassword, 
LoginMethodExample];
+
+/**
+ * User Logout Page
+ * @constructor
+ */
+const Page: React.FC = () => {
+  // run all logout method
+  loginMethods.forEach((item) => {
+    item.logout();
+  });
+
+  const redirect = getUrlQuery('redirect');
+  window.location.href = `/user/login${redirect ? `?redirect=${redirect}` : 
''}`;
+
+  return <div />;

Review comment:
       return null now




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to