Skip to content

Commit

Permalink
fix: error handling when using zombie passkeys (#2034)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoern-m authored Jan 29, 2025
1 parent 849340b commit ce9626d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (a WebauthnVerifyAssertionResponse) Execute(c flowpilot.ExecutionContext) e
return fmt.Errorf("could not create audit log: %w", err)
}

return c.Continue(shared.StateError)
return c.Continue(c.GetCurrentState())
}

return fmt.Errorf("failed to verify assertion response: %w", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (a WebauthnGenerateRequestOptionsForConditionalUi) Execute(c flowpilot.Hook
return fmt.Errorf("failed to generate webauthn request options: %w", err)
}

err = c.Stash().Set(shared.StashPathWebauthnSessionDataID, sessionDataModel.ID)
err = c.Stash().Set(shared.StashPathWebauthnSessionDataID, sessionDataModel.ID.String())
if err != nil {
return fmt.Errorf("failed to stash webauthn_session_data_id: %w", err)
}
Expand Down
4 changes: 0 additions & 4 deletions backend/flowpilot/context_action_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@ func (aec *defaultActionExecutionContext) Revert() error {
}

func (aec *defaultActionExecutionContext) Continue(stateNames ...StateName) error {
if aec.flowError != nil {
return aec.Error(aec.flowError)
}

for _, stateName := range stateNames {
if _, ok := aec.flow.stateDetails[stateName]; !ok {
return fmt.Errorf("cannot continue, state does not exist: %s", stateName)
Expand Down
6 changes: 5 additions & 1 deletion frontend/elements/src/contexts/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ const AppProvider = ({
});
} catch (error) {
const prevState = await state.actions.back(null).run();
setLoadingAction(null);
setUIState((prev) => ({
...prev,
error: state.error,
loadingAction: null,
}));
return hanko.flow.run(prevState, stateHandler);
}

Expand Down

0 comments on commit ce9626d

Please sign in to comment.