Skip to content

Commit ade237e

Browse files
authored
Merge pull request #714 from modelcontextprotocol/halter73/restore-resource
Restore AuthDebuggerState.resource as URL
2 parents 7fc3de7 + bb95fcc commit ade237e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

client/src/components/OAuthDebugCallback.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ const OAuthDebugCallback = ({ onConnect }: OAuthCallbackProps) => {
4646
if (storedState) {
4747
try {
4848
restoredState = JSON.parse(storedState);
49+
if (restoredState && typeof restoredState.resource === "string") {
50+
restoredState.resource = new URL(restoredState.resource);
51+
}
52+
if (
53+
restoredState &&
54+
typeof restoredState.authorizationUrl === "string"
55+
) {
56+
restoredState.authorizationUrl = new URL(
57+
restoredState.authorizationUrl,
58+
);
59+
}
4960
// Clean up the stored state
5061
sessionStorage.removeItem(SESSION_KEYS.AUTH_DEBUGGER_STATE);
5162
} catch (e) {

0 commit comments

Comments
 (0)