fix(session): a .All scope grants the plain scope
A tab whose Graph token carries Files.ReadWrite.All rejected uploads asking for Files.ReadWrite with "not granted". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -3,8 +3,10 @@
3
3
const wanted = (base + '/' + scope).toLowerCase();
4
4
const fresh = (expires) => expires > Date.now() + marginMs;
5
5
const normalize = (value) => value.toLowerCase().replace(/\/\/+(?=[^/]*$)/, '/');
6
const grants = (scopes) => scopes.some(s => normalize(s) === wanted
7
|| (base === 'https://graph.microsoft.com' && s.toLowerCase() === scope.toLowerCase()));
6
const short = scope.toLowerCase();
7
const covers = (value, name) => value === name || value === name + '.all';
8
const grants = (scopes) => scopes.some(s => covers(normalize(s), wanted)
9
|| (base === 'https://graph.microsoft.com' && covers(s.toLowerCase(), short)));
8
10
const entries = [];
9
11
let activeHome = null;
10
12
for (let index = 0; index < localStorage.length; index++) {
@@ -3,8 +3,10 @@3
const wanted = (base + '/' + scope).toLowerCase();3
const wanted = (base + '/' + scope).toLowerCase();4
const fresh = (expires) => expires > Date.now() + marginMs;4
const fresh = (expires) => expires > Date.now() + marginMs;5
const normalize = (value) => value.toLowerCase().replace(/\/\/+(?=[^/]*$)/, '/');5
const normalize = (value) => value.toLowerCase().replace(/\/\/+(?=[^/]*$)/, '/');6
const grants = (scopes) => scopes.some(s => normalize(s) === wanted6
const short = scope.toLowerCase();7
|| (base === 'https://graph.microsoft.com' && s.toLowerCase() === scope.toLowerCase()));7
const covers = (value, name) => value === name || value === name + '.all';8
const grants = (scopes) => scopes.some(s => covers(normalize(s), wanted)9
|| (base === 'https://graph.microsoft.com' && covers(s.toLowerCase(), short)));8
const entries = [];10
const entries = [];9
let activeHome = null;11
let activeHome = null;10
for (let index = 0; index < localStorage.length; index++) {12
for (let index = 0; index < localStorage.length; index++) {