correctly clear scope

This commit is contained in:
Stanislav Deviatykh 2025-10-22 00:09:57 +03:00
commit eb76696d97

View file

@ -46,6 +46,7 @@ import {
InspectorOAuthClientProvider,
saveClientInformationToSessionStorage,
saveScopeToSessionStorage,
clearScopeFromSessionStorage,
discoverScopes,
} from "../auth";
import {
@ -144,6 +145,11 @@ export function useConnection({
}, [oauthClientId, oauthClientSecret, sseUrl]);
useEffect(() => {
if (!oauthScope) {
clearScopeFromSessionStorage(sseUrl);
return;
}
saveScopeToSessionStorage(sseUrl, oauthScope);
}, [oauthScope, sseUrl]);