your personal website on atproto - mirror blento.app

fix logout on refresh

Florian 680d33ce d15e10ba

+3 -1
+3 -1
src/lib/atproto/auth.svelte.ts
··· 206 206 throw Error('session expired'); 207 207 } 208 208 209 - if (session.token.scope !== metadata.scope) { 209 + const requestedScopes = metadata.scope.split(' ').filter((s) => !s.startsWith('include:')); 210 + const tokenScopes = new Set(session.token.scope?.split(' ')); 211 + if (!requestedScopes.every((s) => tokenScopes.has(s))) { 210 212 throw Error('scope changed, signing out!'); 211 213 } 212 214