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 throw Error('session expired'); 207 } 208 209 - if (session.token.scope !== metadata.scope) { 210 throw Error('scope changed, signing out!'); 211 } 212
··· 206 throw Error('session expired'); 207 } 208 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))) { 212 throw Error('scope changed, signing out!'); 213 } 214