Skip to content

Commit

Permalink
refactor: Moved logout button
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Sep 22, 2023
1 parent db5cf2b commit 1df1a2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export function App() {
<>
<AuthenticatedTemplate>
<AppBar title="PEPM" />
<p>Authenticated</p>
<button onClick={() => instance.logoutRedirect()}>Log out</button>
<Styled.OutletWrapper>
<Outlet />
</Styled.OutletWrapper>
Expand Down
5 changes: 4 additions & 1 deletion src/features/AppBar/Icons/Icons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMsal } from '@azure/msal-react'
import { Menu } from '@equinor/eds-core-react'
import { Button, Menu } from '@equinor/eds-core-react'
import {
account_circle as accountCircle,
notifications,
Expand Down Expand Up @@ -29,6 +29,9 @@ export const Icons = () => {
<MenuIcon icon={icons.userInfo}>
<Menu.Section title="Logged in">
<Menu.Item>{instance.getActiveAccount()?.name}</Menu.Item>
<Menu.Item>
<Button onClick={() => instance.logoutRedirect()}>Log out</Button>
</Menu.Item>
</Menu.Section>
</MenuIcon>
</Styled.Icons>
Expand Down

0 comments on commit 1df1a2d

Please sign in to comment.