core: token without a scope is invalid

This commit is contained in:
Abdullah Atta
2024-05-11 12:36:18 +05:00
parent a2e7190a4a
commit da7d79edc6

View File

@@ -94,7 +94,7 @@ class TokenManager {
) {
return await getSafeToken(async () => {
const token = await this.getToken(true, forceRenew);
if (!token) return;
if (!token || !token.scope) return;
if (!scopes.some((s) => token.scope.includes(s))) return;
return token.access_token;
}, "Error getting access token:");