fix: update nsecBunker delegated key after logout
All checks were successful
Release / build_and_release (push) Successful in 42s

This commit is contained in:
Sabir Hassan 2024-03-19 12:29:24 +05:00
parent 3626368e95
commit 962b2bcea6

View File

@ -18,8 +18,9 @@ import { Link, useNavigate } from 'react-router-dom'
import nostrichAvatar from '../../assets/images/avatar.png' import nostrichAvatar from '../../assets/images/avatar.png'
import nostrichLogo from '../../assets/images/nostr-logo.jpg' import nostrichLogo from '../../assets/images/nostr-logo.jpg'
import { appPublicRoutes, getProfileRoute } from '../../routes' import { appPublicRoutes, getProfileRoute } from '../../routes'
import { shorten } from '../../utils' import { saveNsecBunkerDelegatedKey, shorten } from '../../utils'
import styles from './style.module.scss' import styles from './style.module.scss'
import { NostrController } from '../../controllers'
export const AppBar = () => { export const AppBar = () => {
const navigate = useNavigate() 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('/') navigate('/')
} }
const isAuthenticated = authState?.loggedIn === true const isAuthenticated = authState?.loggedIn === true