Bug 1920419 - Fix what happens if an *.oauth2.scope pref is empty. r=mkmelin

Differential Revision: https://phabricator.services.mozilla.com/D223251

--HG--
extra : rebase_source : 5cf4f446f51d7d4226fedde55143413ecbdc516e
This commit is contained in:
Geoff Lankow 2024-09-24 14:34:58 +12:00
Родитель 1aa9dd807e
Коммит 15999f476e
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -73,7 +73,9 @@ OAuth2Module.prototype = {
const details = OAuth2Providers.getHostnameDetails(aHostname);
if (
details &&
(details[0] != issuer || !scopeSet(details[1]).isSupersetOf(prefScopes))
(details[0] != issuer ||
!scope ||
!scopeSet(details[1]).isSupersetOf(prefScopes))
) {
if (details[0] != issuer) {
log.info(
@ -82,7 +84,7 @@ OAuth2Module.prototype = {
}
if (!scopeSet(details[1]).isSupersetOf(prefScopes)) {
log.info(
`${root}oauth2.scope "${scope}" is not a superset of "${details[1]}"`
`${root}oauth2.scope "${scope}" is not a subset of "${details[1]}"`
);
}
// Found in the list of hardcoded providers. Use the hardcoded values.