We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e711766 commit 7dbc12aCopy full SHA for 7dbc12a
server/utils/atproto/oauth-session-store.ts
@@ -30,11 +30,17 @@ export class OAuthSessionStore implements NodeSavedSessionStore {
30
}
31
32
async set(key: string, val: NodeSavedSession) {
33
- let sessionId = crypto.randomUUID()
34
- try {
+ const serverSessionData = this.serverSession.data
+ let sessionId
35
+ if (!serverSessionData.oauthSessionId) {
36
+ sessionId = crypto.randomUUID()
37
await this.serverSession.update({
38
oauthSessionId: sessionId,
39
})
40
+ } else {
41
+ sessionId = serverSessionData.oauthSessionId
42
+ }
43
+ try {
44
await this.storage.setItem<NodeSavedSession>(this.createStorageKey(key, sessionId), val)
45
} catch (error) {
46
// Not sure if this has been happening. But helps with debugging
0 commit comments