MCPcopy Create free account
hub / github.com/modelcontextprotocol/inspector / loadOAuthTokens

Function loadOAuthTokens

client/src/App.tsx:690–708  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

688
689 useEffect(() => {
690 const loadOAuthTokens = async () => {
691 try {
692 if (sseUrl) {
693 const key = getServerSpecificKey(SESSION_KEYS.TOKENS, sseUrl);
694 const tokens = sessionStorage.getItem(key);
695 if (tokens) {
696 const parsedTokens = await OAuthTokensSchema.parseAsync(
697 JSON.parse(tokens),
698 );
699 updateAuthState({
700 oauthTokens: parsedTokens,
701 oauthStep: "complete",
702 });
703 }
704 }
705 } catch (error) {
706 console.error("Error loading OAuth tokens:", error);
707 }
708 };
709
710 loadOAuthTokens();
711 }, [sseUrl]);

Callers 1

AppFunction · 0.85

Calls 2

getServerSpecificKeyFunction · 0.90
updateAuthStateFunction · 0.85

Tested by

no test coverage detected