Merge pull request #714 from modelcontextprotocol/halter73/restore-resource

Restore AuthDebuggerState.resource as URL
This commit is contained in:
Ola Hungerford 2025-08-20 07:19:07 -07:00 • committed by GitHub
commit ade237ee6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,6 +46,17 @@ const OAuthDebugCallback = ({ onConnect }: OAuthCallbackProps) => {
if (storedState) {
try {
restoredState = JSON.parse(storedState);
if (restoredState && typeof restoredState.resource === "string") {
restoredState.resource = new URL(restoredState.resource);
}
if (
restoredState &&
typeof restoredState.authorizationUrl === "string"
) {
restoredState.authorizationUrl = new URL(
restoredState.authorizationUrl,
);
}
// Clean up the stored state
sessionStorage.removeItem(SESSION_KEYS.AUTH_DEBUGGER_STATE);
} catch (e) {