whitespace
This commit is contained in:
parent
03bb303bf9
commit
11bc04364b
2 changed files with 43 additions and 43 deletions
|
|
@ -242,47 +242,47 @@ const AuthDebugger = ({
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{authState.oauthTokens && (
|
{authState.oauthTokens && (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<p className="text-sm font-medium">Access Token:</p>
|
<p className="text-sm font-medium">Access Token:</p>
|
||||||
<div className="bg-muted p-2 rounded-md text-xs overflow-x-auto">
|
<div className="bg-muted p-2 rounded-md text-xs overflow-x-auto">
|
||||||
{authState.oauthTokens.access_token.substring(0, 25)}...
|
{authState.oauthTokens.access_token.substring(0, 25)}...
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="flex gap-4">
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
onClick={startOAuthFlow}
|
|
||||||
disabled={authState.isInitiatingAuth}
|
|
||||||
>
|
|
||||||
{authState.oauthTokens
|
|
||||||
? "Guided Token Refresh"
|
|
||||||
: "Guided OAuth Flow"}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
onClick={handleQuickOAuth}
|
|
||||||
disabled={authState.isInitiatingAuth}
|
|
||||||
>
|
|
||||||
{authState.isInitiatingAuth
|
|
||||||
? "Initiating..."
|
|
||||||
: authState.oauthTokens
|
|
||||||
? "Quick Refresh"
|
|
||||||
: "Quick OAuth Flow"}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Button variant="outline" onClick={handleClearOAuth}>
|
|
||||||
Clear OAuth State
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<p className="text-xs text-muted-foreground">
|
<div className="flex gap-4">
|
||||||
Choose "Guided" for step-by-step instructions or "Quick" for
|
<Button
|
||||||
the standard automatic flow.
|
variant="outline"
|
||||||
</p>
|
onClick={startOAuthFlow}
|
||||||
|
disabled={authState.isInitiatingAuth}
|
||||||
|
>
|
||||||
|
{authState.oauthTokens
|
||||||
|
? "Guided Token Refresh"
|
||||||
|
: "Guided OAuth Flow"}
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
onClick={handleQuickOAuth}
|
||||||
|
disabled={authState.isInitiatingAuth}
|
||||||
|
>
|
||||||
|
{authState.isInitiatingAuth
|
||||||
|
? "Initiating..."
|
||||||
|
: authState.oauthTokens
|
||||||
|
? "Quick Refresh"
|
||||||
|
: "Quick OAuth Flow"}
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button variant="outline" onClick={handleClearOAuth}>
|
||||||
|
Clear OAuth State
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
Choose "Guided" for step-by-step instructions or "Quick" for
|
||||||
|
the standard automatic flow.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<OAuthFlowProgress
|
<OAuthFlowProgress
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ describe("AuthDebugger", () => {
|
||||||
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
|
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
|
||||||
mockRegisterClient.mockResolvedValue(mockOAuthClientInfo);
|
mockRegisterClient.mockResolvedValue(mockOAuthClientInfo);
|
||||||
mockDiscoverOAuthProtectedResourceMetadata.mockRejectedValue(
|
mockDiscoverOAuthProtectedResourceMetadata.mockRejectedValue(
|
||||||
new Error("No protected resource metadata found")
|
new Error("No protected resource metadata found"),
|
||||||
);
|
);
|
||||||
mockStartAuthorization.mockImplementation(async (_sseUrl, options) => {
|
mockStartAuthorization.mockImplementation(async (_sseUrl, options) => {
|
||||||
const authUrl = new URL("https://oauth.example.com/authorize");
|
const authUrl = new URL("https://oauth.example.com/authorize");
|
||||||
|
|
@ -503,7 +503,7 @@ describe("AuthDebugger", () => {
|
||||||
|
|
||||||
// Mock successful metadata discovery
|
// Mock successful metadata discovery
|
||||||
mockDiscoverOAuthProtectedResourceMetadata.mockResolvedValue(
|
mockDiscoverOAuthProtectedResourceMetadata.mockResolvedValue(
|
||||||
mockResourceMetadata
|
mockResourceMetadata,
|
||||||
);
|
);
|
||||||
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
|
mockDiscoverOAuthMetadata.mockResolvedValue(mockOAuthMetadata);
|
||||||
|
|
||||||
|
|
@ -536,7 +536,7 @@ describe("AuthDebugger", () => {
|
||||||
// Wait for the metadata to be fetched
|
// Wait for the metadata to be fetched
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(mockDiscoverOAuthProtectedResourceMetadata).toHaveBeenCalledWith(
|
expect(mockDiscoverOAuthProtectedResourceMetadata).toHaveBeenCalledWith(
|
||||||
"https://example.com"
|
"https://example.com",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -547,7 +547,7 @@ describe("AuthDebugger", () => {
|
||||||
resourceMetadata: mockResourceMetadata,
|
resourceMetadata: mockResourceMetadata,
|
||||||
authServerUrl: new URL("https://custom-auth.example.com"),
|
authServerUrl: new URL("https://custom-auth.example.com"),
|
||||||
oauthStep: "client_registration",
|
oauthStep: "client_registration",
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -582,7 +582,7 @@ describe("AuthDebugger", () => {
|
||||||
// Wait for the metadata fetch to fail
|
// Wait for the metadata fetch to fail
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(mockDiscoverOAuthProtectedResourceMetadata).toHaveBeenCalledWith(
|
expect(mockDiscoverOAuthProtectedResourceMetadata).toHaveBeenCalledWith(
|
||||||
"https://example.com"
|
"https://example.com",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -594,13 +594,13 @@ describe("AuthDebugger", () => {
|
||||||
// Should use the original server URL as fallback
|
// Should use the original server URL as fallback
|
||||||
authServerUrl: new URL("https://example.com"),
|
authServerUrl: new URL("https://example.com"),
|
||||||
oauthStep: "client_registration",
|
oauthStep: "client_registration",
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Verify that regular OAuth metadata discovery was still called
|
// Verify that regular OAuth metadata discovery was still called
|
||||||
expect(mockDiscoverOAuthMetadata).toHaveBeenCalledWith(
|
expect(mockDiscoverOAuthMetadata).toHaveBeenCalledWith(
|
||||||
new URL("https://example.com")
|
new URL("https://example.com"),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue