diff --git a/src/components/AppBar/AppBar.tsx b/src/components/AppBar/AppBar.tsx index 66793ca..04aa4ba 100644 --- a/src/components/AppBar/AppBar.tsx +++ b/src/components/AppBar/AppBar.tsx @@ -18,8 +18,9 @@ import { Link, useNavigate } from 'react-router-dom' import nostrichAvatar from '../../assets/images/avatar.png' import nostrichLogo from '../../assets/images/nostr-logo.jpg' import { appPublicRoutes, getProfileRoute } from '../../routes' -import { shorten } from '../../utils' +import { saveNsecBunkerDelegatedKey, shorten } from '../../utils' import styles from './style.module.scss' +import { NostrController } from '../../controllers' export const AppBar = () => { const navigate = useNavigate() @@ -66,6 +67,11 @@ export const AppBar = () => { }) ) + // update nsecBunker delegated key after logout + const nostrController = NostrController.getInstance() + const newDelegatedKey = nostrController.generateDelegatedKey() + saveNsecBunkerDelegatedKey(newDelegatedKey) + navigate('/') } const isAuthenticated = authState?.loggedIn === true