Skip to content

Commit 2d7936d

Browse files
committed
fix type errors
1 parent e74f80d commit 2d7936d

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

client/src/components/OAuthDebugCallback.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
generateOAuthErrorDescription,
55
parseOAuthCallbackParams,
66
} from "@/utils/oauthUtils.ts";
7+
import { AuthDebuggerState } from "@/lib/auth-types";
78

89
interface OAuthCallbackProps {
910
onConnect: ({
@@ -13,7 +14,7 @@ interface OAuthCallbackProps {
1314
}: {
1415
authorizationCode?: string;
1516
errorMsg?: string;
16-
restoredState?: any;
17+
restoredState?: AuthDebuggerState;
1718
}) => void;
1819
}
1920

client/src/components/__tests__/AuthDebugger.test.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,16 @@ describe("AuthDebugger", () => {
441441
const updateAuthState = jest.fn();
442442

443443
// Mock window.location.href setter
444-
delete (window as any).location;
445-
window.location = { href: "" } as any;
444+
const originalLocation = window.location;
445+
const locationMock = {
446+
...originalLocation,
447+
href: "",
448+
origin: "http://localhost:3000"
449+
};
450+
Object.defineProperty(window, 'location', {
451+
writable: true,
452+
value: locationMock
453+
});
446454

447455
// Setup mocks for OAuth flow
448456
mockStartAuthorization.mockResolvedValue({

client/src/lib/auth-types.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ export interface AuthDebuggerState {
2929
oauthTokens: OAuthTokens | null;
3030
oauthStep: OAuthStep;
3131
resourceMetadata: OAuthProtectedResourceMetadata | null;
32-
resourceMetadataError:
33-
| Error
34-
| { status: number; statusText: string; message: string }
35-
| null;
32+
resourceMetadataError: Error | null;
3633
authServerUrl: URL | null;
3734
oauthMetadata: OAuthMetadata | null;
3835
oauthClientInfo: OAuthClientInformationFull | OAuthClientInformation | null;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"test-cli": "cd cli && npm run test",
3737
"prettier-fix": "prettier --write .",
3838
"prettier-check": "prettier --check .",
39+
"lint": "prettier --check . && cd client && npm run lint",
3940
"prepare": "npm run build",
4041
"publish-all": "npm publish --workspaces --access public && npm publish --access public"
4142
},

0 commit comments

Comments
 (0)