fix(auth): make IndeeHub sign-out forget app selection

This commit is contained in:
archipelago
2026-10-09 05:49:47 -04:00
parent 44a3334f99
commit b537009198
8 changed files with 86 additions and 0 deletions
@@ -66,6 +66,25 @@ describe('NostrTabSigner visibility', () => {
expect(document.body.classList.contains('nostr-signer-route')).toBe(false)
})
it('forgets the remembered app selection when the app signs out', async () => {
localStorage.setItem('archipelago_app_identity_indeedhub', JSON.stringify({
id: 'identity-a', name: 'Alice', nostr_pubkey: 'a'.repeat(64),
}))
localStorage.setItem('unrelated-node-identity', 'preserved')
const wrapper = shallowMount(NostrTabSigner)
try {
parentMessage({ type: 'archipelago:signer-init', appId: 'indeedhub', appName: 'IndeeHub' })
parentMessage({ type: 'archipelago:signer-clear-session' })
await flushPromises()
expect(localStorage.getItem('archipelago_app_identity_indeedhub')).toBeNull()
expect(localStorage.getItem('unrelated-node-identity')).toBe('preserved')
expect(wrapper.findComponent(NostrIdentityPicker).props('show')).toBe(false)
} finally {
wrapper.unmount()
}
})
it('hands off a reactive picker identity as cloneable public fields and releases the overlay', async () => {
vi.useFakeTimers()
const sent: Array<Record<string, unknown>> = []