Skip to content

Commit adaa023

Browse files
committed
test and types
1 parent 78c9c21 commit adaa023

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe("AuthDebugger", () => {
8686
isInitiatingAuth: false,
8787
oauthTokens: null,
8888
loading: false,
89-
oauthStep: "not_started" as const,
89+
oauthStep: "metadata_discovery" as const,
9090
oauthMetadata: null,
9191
oauthClientInfo: null,
9292
authorizationUrl: null,
@@ -264,9 +264,10 @@ describe("AuthDebugger", () => {
264264

265265
expect(updateAuthState).toHaveBeenCalledWith({
266266
oauthTokens: null,
267-
oauthStep: "not_started",
267+
oauthStep: "metadata_discovery",
268268
latestError: null,
269269
oauthClientInfo: null,
270+
oauthMetadata: null,
270271
authorizationCode: "",
271272
validationError: null,
272273
statusMessage: {
@@ -330,7 +331,7 @@ describe("AuthDebugger", () => {
330331
authState: {
331332
...defaultAuthState,
332333
isInitiatingAuth: false,
333-
oauthStep: "client_registration",
334+
oauthStep: "authorization_redirect",
334335
oauthMetadata: metadata,
335336
oauthClientInfo: mockOAuthClientInfo,
336337
},

client/src/lib/oauth-state-machine.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ export interface StateTransition {
2323

2424
// State machine transitions
2525
export const oauthTransitions: Record<OAuthStep, StateTransition> = {
26-
not_started: {
27-
canTransition: async () => true,
28-
execute: async (context) => {
29-
context.updateState({
30-
oauthStep: "metadata_discovery",
31-
statusMessage: null,
32-
latestError: null,
33-
});
34-
},
35-
nextStep: "metadata_discovery",
36-
},
37-
3826
metadata_discovery: {
3927
canTransition: async () => true,
4028
execute: async (context) => {
@@ -160,7 +148,7 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
160148
},
161149

162150
complete: {
163-
canTransition: () => false,
151+
canTransition: async () => false,
164152
execute: async () => {
165153
// No-op for complete state
166154
},

0 commit comments

Comments
 (0)