fix type errors
This commit is contained in:
parent
e74f80db85
commit
2d7936d10b
4 changed files with 14 additions and 7 deletions
|
|
@ -4,6 +4,7 @@ import {
|
||||||
generateOAuthErrorDescription,
|
generateOAuthErrorDescription,
|
||||||
parseOAuthCallbackParams,
|
parseOAuthCallbackParams,
|
||||||
} from "@/utils/oauthUtils.ts";
|
} from "@/utils/oauthUtils.ts";
|
||||||
|
import { AuthDebuggerState } from "@/lib/auth-types";
|
||||||
|
|
||||||
interface OAuthCallbackProps {
|
interface OAuthCallbackProps {
|
||||||
onConnect: ({
|
onConnect: ({
|
||||||
|
|
@ -13,7 +14,7 @@ interface OAuthCallbackProps {
|
||||||
}: {
|
}: {
|
||||||
authorizationCode?: string;
|
authorizationCode?: string;
|
||||||
errorMsg?: string;
|
errorMsg?: string;
|
||||||
restoredState?: any;
|
restoredState?: AuthDebuggerState;
|
||||||
}) => void;
|
}) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -441,8 +441,16 @@ describe("AuthDebugger", () => {
|
||||||
const updateAuthState = jest.fn();
|
const updateAuthState = jest.fn();
|
||||||
|
|
||||||
// Mock window.location.href setter
|
// Mock window.location.href setter
|
||||||
delete (window as any).location;
|
const originalLocation = window.location;
|
||||||
window.location = { href: "" } as any;
|
const locationMock = {
|
||||||
|
...originalLocation,
|
||||||
|
href: "",
|
||||||
|
origin: "http://localhost:3000"
|
||||||
|
};
|
||||||
|
Object.defineProperty(window, 'location', {
|
||||||
|
writable: true,
|
||||||
|
value: locationMock
|
||||||
|
});
|
||||||
|
|
||||||
// Setup mocks for OAuth flow
|
// Setup mocks for OAuth flow
|
||||||
mockStartAuthorization.mockResolvedValue({
|
mockStartAuthorization.mockResolvedValue({
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,7 @@ export interface AuthDebuggerState {
|
||||||
oauthTokens: OAuthTokens | null;
|
oauthTokens: OAuthTokens | null;
|
||||||
oauthStep: OAuthStep;
|
oauthStep: OAuthStep;
|
||||||
resourceMetadata: OAuthProtectedResourceMetadata | null;
|
resourceMetadata: OAuthProtectedResourceMetadata | null;
|
||||||
resourceMetadataError:
|
resourceMetadataError: Error | null;
|
||||||
| Error
|
|
||||||
| { status: number; statusText: string; message: string }
|
|
||||||
| null;
|
|
||||||
authServerUrl: URL | null;
|
authServerUrl: URL | null;
|
||||||
oauthMetadata: OAuthMetadata | null;
|
oauthMetadata: OAuthMetadata | null;
|
||||||
oauthClientInfo: OAuthClientInformationFull | OAuthClientInformation | null;
|
oauthClientInfo: OAuthClientInformationFull | OAuthClientInformation | null;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
"test-cli": "cd cli && npm run test",
|
"test-cli": "cd cli && npm run test",
|
||||||
"prettier-fix": "prettier --write .",
|
"prettier-fix": "prettier --write .",
|
||||||
"prettier-check": "prettier --check .",
|
"prettier-check": "prettier --check .",
|
||||||
|
"lint": "prettier --check . && cd client && npm run lint",
|
||||||
"prepare": "npm run build",
|
"prepare": "npm run build",
|
||||||
"publish-all": "npm publish --workspaces --access public && npm publish --access public"
|
"publish-all": "npm publish --workspaces --access public && npm publish --access public"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue