[Session] Reset global agent on expire (#3838)
parent
cdf7a1957a
commit
1e484c6318
|
@ -145,6 +145,16 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||||
if (expired) {
|
if (expired) {
|
||||||
logger.warn(`session: expired`)
|
logger.warn(`session: expired`)
|
||||||
emitSessionDropped()
|
emitSessionDropped()
|
||||||
|
__globalAgent = PUBLIC_BSKY_AGENT
|
||||||
|
configureModerationForGuest()
|
||||||
|
setState(s => ({
|
||||||
|
accounts: s.accounts,
|
||||||
|
currentAgentState: {
|
||||||
|
agent: PUBLIC_BSKY_AGENT,
|
||||||
|
did: undefined,
|
||||||
|
},
|
||||||
|
needsPersist: true,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -175,12 +185,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||||
refreshedAccount,
|
refreshedAccount,
|
||||||
...s.accounts.filter(a => a.did !== refreshedAccount.did),
|
...s.accounts.filter(a => a.did !== refreshedAccount.did),
|
||||||
],
|
],
|
||||||
currentAgentState: expired
|
currentAgentState: s.currentAgentState,
|
||||||
? {
|
|
||||||
agent: PUBLIC_BSKY_AGENT,
|
|
||||||
did: undefined,
|
|
||||||
}
|
|
||||||
: s.currentAgentState,
|
|
||||||
needsPersist: true,
|
needsPersist: true,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue