Skip to content

Commit e408519

Browse files
larsdeckerCopilot
andauthored
Update packages/fints/src/dialog.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 25ab841 commit e408519

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

packages/fints/src/dialog.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,17 @@ export class Dialog extends DialogConfig {
282282
* @see https://www.hbci-zka.de/ for FinTS specification
283283
*/
284284
public async handleDecoupledTan(
285-
transactionReference: string,
286-
challengeText: string,
285+
// Ensure TAN methods are available before attempting decoupled TAN handling
286+
if (!this.tanMethods || this.tanMethods.length === 0) {
287+
throw new Error(
288+
"No TAN methods are available for decoupled TAN handling. " +
289+
"Ensure the dialog is properly initialized and TAN methods have been retrieved.",
290+
);
291+
}
292+
293+
// Find the appropriate TAN method (prefer one with decoupled support)
294+
const tanMethod =
295+
this.tanMethods.find((m) => m.decoupledMaxStatusRequests !== undefined) || this.tanMethods[0];
287296
statusCallback?: DecoupledTanStatusCallback,
288297
): Promise<Response> {
289298
// Find the appropriate TAN method (prefer one with decoupled support)

0 commit comments

Comments
 (0)