Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Check formatting
run: npx prettier --check .
run: npx prettier@3.7.4 --check .

- uses: actions/setup-node@v4
with:
Expand Down
13 changes: 10 additions & 3 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,14 @@ const App = () => {
};

try {
const stateMachine = new OAuthStateMachine(sseUrl, (updates) => {
currentState = { ...currentState, ...updates };
});
const stateMachine = new OAuthStateMachine(
sseUrl,
(updates) => {
currentState = { ...currentState, ...updates };
},
connectionType,
config,
);

while (
currentState.oauthStep !== "complete" &&
Expand Down Expand Up @@ -917,6 +922,8 @@ const App = () => {
onBack={() => setIsAuthDebuggerVisible(false)}
authState={authState}
updateAuthState={updateAuthState}
connectionType={connectionType}
config={config}
/>
</TabsContent>
);
Expand Down
25 changes: 18 additions & 7 deletions client/src/components/AuthDebugger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import { OAuthFlowProgress } from "./OAuthFlowProgress";
import { OAuthStateMachine } from "../lib/oauth-state-machine";
import { SESSION_KEYS } from "../lib/constants";
import { validateRedirectUrl } from "@/utils/urlValidation";
import { InspectorConfig } from "../lib/configurationTypes";

export interface AuthDebuggerProps {
serverUrl: string;
onBack: () => void;
authState: AuthDebuggerState;
updateAuthState: (updates: Partial<AuthDebuggerState>) => void;
connectionType: "direct" | "proxy";
config: InspectorConfig;
}

interface StatusMessageProps {
Expand Down Expand Up @@ -60,6 +63,8 @@ const AuthDebugger = ({
onBack,
authState,
updateAuthState,
connectionType,
config,
}: AuthDebuggerProps) => {
// Check for existing tokens on mount
useEffect(() => {
Expand Down Expand Up @@ -103,8 +108,9 @@ const AuthDebugger = ({
}, [serverUrl, updateAuthState]);

const stateMachine = useMemo(
() => new OAuthStateMachine(serverUrl, updateAuthState),
[serverUrl, updateAuthState],
() =>
new OAuthStateMachine(serverUrl, updateAuthState, connectionType, config),
[serverUrl, updateAuthState, connectionType, config],
);

const proceedToNextStep = useCallback(async () => {
Expand Down Expand Up @@ -150,11 +156,16 @@ const AuthDebugger = ({
latestError: null,
};

const oauthMachine = new OAuthStateMachine(serverUrl, (updates) => {
// Update our temporary state during the process
currentState = { ...currentState, ...updates };
// But don't call updateAuthState yet
});
const oauthMachine = new OAuthStateMachine(
serverUrl,
(updates) => {
// Update our temporary state during the process
currentState = { ...currentState, ...updates };
// But don't call updateAuthState yet
},
connectionType,
config,
);

// Manually step through each stage of the OAuth flow
while (currentState.oauthStep !== "complete") {
Expand Down
Loading