Repository: provectus/kafka-ui
Issue: Log out button
Labels: status/duplicate
type/enhancement
scope/backend
scope/frontend

### Is your proposal related to a problem?

<!--
  Provide a clear and concise description of what the problem is.
  For example, "I'm always frustrated when..."
-->
logout button after LDAP/SSO login
### Describe the solution you'd like
Right corner a small button with logout
<!--
  Provide a clear and concise description of what you want to happen.
-->

### Describe alternatives you've considered
Session timeout after N seconds
<!--
  Let us know about other solutions you've tried or researched.
-->

### Additional context

<!--
  Is there anything else you can add about the proposal?
  You might want to link to related issues here, if you haven't already.
-->



Issue comments:
Hey, thanks for reaching out. We were planning on implementing this within #1021, but I guess we can do it quicker.
duplicate of #1175

Pull request review comments:
so this is a button without any functionality ?
Yes, I've talked with Roma, he said only the UI is required. The backend is not ready yet for the logout action.
I've mentioned in the PR that this is a UI addition.

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/App.styled.ts b/kafka-ui-react-app/src/components/App.styled.ts
index b35b324828c..64f3296861d 100644
--- a/kafka-ui-react-app/src/components/App.styled.ts
+++ b/kafka-ui-react-app/src/components/App.styled.ts
@@ -1,6 +1,8 @@
 import styled, { css } from 'styled-components';
 import { Link } from 'react-router-dom';
 
+import { Button } from './common/Button/Button';
+
 export const Layout = styled.div`
   min-width: 1200px;
 
@@ -108,6 +110,8 @@ export const Navbar = styled.nav(
 
 export const NavbarBrand = styled.div`
   display: flex;
+  justify-content: space-between;
+  align-items: center !important;
   flex-shrink: 0;
   align-items: stretch;
   min-height: 3.25rem;
@@ -205,3 +209,17 @@ export const AlertsContainer = styled.div`
     max-width: initial;
   }
 `;
+
+export const LogoutButton = styled(Button)(
+  ({ theme }) => css`
+    color: ${theme.button.primary.invertedColors.normal};
+    background: none !important;
+    padding: 0 8px;
+  `
+);
+
+export const LogoutLink = styled(Link)(
+  () => css`
+    margin-right: 16px;
+  `
+);
diff --git a/kafka-ui-react-app/src/components/App.tsx b/kafka-ui-react-app/src/components/App.tsx
index 5f4824f125d..c0740f79417 100644
--- a/kafka-ui-react-app/src/components/App.tsx
+++ b/kafka-ui-react-app/src/components/App.tsx
@@ -44,25 +44,33 @@ const App: React.FC = () => {
       <S.Layout>
         <S.Navbar role="navigation" aria-label="Page Header">
           <S.NavbarBrand>
-            <S.NavbarBurger
-              onClick={onBurgerClick}
-              onKeyDown={onBurgerClick}
-              role="button"
-              tabIndex={0}
-            >
-              <S.Span role="separator" />
-              <S.Span role="separator" />
-              <S.Span role="separator" />
-            </S.NavbarBurger>
+            <S.NavbarBrand>
+              <S.NavbarBurger
+                onClick={onBurgerClick}
+                onKeyDown={onBurgerClick}
+                role="button"
+                tabIndex={0}
+                aria-label="burger"
+              >
+                <S.Span role="separator" />
+                <S.Span role="separator" />
+                <S.Span role="separator" />
+              </S.NavbarBurger>
 
-            <S.Hyperlink to="/">
-              <Logo />
-              UI for Apache Kafka
-            </S.Hyperlink>
+              <S.Hyperlink to="/">
+                <Logo />
+                UI for Apache Kafka
+              </S.Hyperlink>
 
-            <S.NavbarItem>
-              {GIT_TAG && <Version tag={GIT_TAG} commit={GIT_COMMIT} />}
-            </S.NavbarItem>
+              <S.NavbarItem>
+                {GIT_TAG && <Version tag={GIT_TAG} commit={GIT_COMMIT} />}
+              </S.NavbarItem>
+            </S.NavbarBrand>
+            <S.LogoutLink to="/logout">
+              <S.LogoutButton buttonType="primary" buttonSize="M">
+                Log out
+              </S.LogoutButton>
+            </S.LogoutLink>
           </S.NavbarBrand>
         </S.Navbar>
 
diff --git a/kafka-ui-react-app/src/components/__tests__/App.spec.tsx b/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
index c7cf41ecd8d..9f48fb25ada 100644
--- a/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
+++ b/kafka-ui-react-app/src/components/__tests__/App.spec.tsx
@@ -6,6 +6,9 @@ import { clustersPayload } from 'redux/reducers/clusters/__test__/fixtures';
 import userEvent from '@testing-library/user-event';
 import fetchMock from 'fetch-mock';
 
+const burgerButtonOptions = { name: 'burger' };
+const logoutButtonOptions = { name: 'Log out' };
+
 describe('App', () => {
   describe('initial state', () => {
     beforeEach(() => {
@@ -24,11 +27,16 @@ describe('App', () => {
         within(header).getByText('UI for Apache Kafka')
       ).toBeInTheDocument();
       expect(within(header).getAllByRole('separator').length).toEqual(3);
-      expect(within(header).getByRole('button')).toBeInTheDocument();
+      expect(
+        within(header).getByRole('button', burgerButtonOptions)
+      ).toBeInTheDocument();
+      expect(
+        within(header).getByRole('button', logoutButtonOptions)
+      ).toBeInTheDocument();
     });
     it('handle burger click correctly', () => {
       const header = screen.getByLabelText('Page Header');
-      const burger = within(header).getByRole('button');
+      const burger = within(header).getByRole('button', burgerButtonOptions);
       const sidebar = screen.getByLabelText('Sidebar');
       const overlay = screen.getByLabelText('Overlay');
       expect(sidebar).toBeInTheDocument();


Test patch: