Skip to content

IS-10603 Use updated polling logic for BankID signing consentor.#80

Merged
phylexm merged 1 commit intodevfrom
feature/dev/IS-10603-bankid-consentor-update-polling-logic
Mar 18, 2026
Merged

IS-10603 Use updated polling logic for BankID signing consentor.#80
phylexm merged 1 commit intodevfrom
feature/dev/IS-10603-bankid-consentor-update-polling-logic

Conversation

@phylexm
Copy link
Copy Markdown

@phylexm phylexm commented Mar 11, 2026

  • Factorize BankID authenticator polling logic Version 2 to shared fragments
  • Use polling logic Version 2 in BankID signing authenticator, based on a feature flag (bankidConsentorLaunchVersion2). Old polling logic remains the default one.

While reviewing, pay attention to all moved templates: this is considered as breaking changes, and may be some of them cannot be simply moved ?

Copilot AI review requested due to automatic review settings March 11, 2026 14:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the BankID “launch v2” client-side flow into shared template fragments and wires it into both the authenticator BankID launch page and the BankID signing consentor, controlled by new Velocity settings flags.

Changes:

  • Introduces shared BankID polling and app-launcher fragments, plus per-flow “polling settings” templates to configure selectors/callbacks.
  • Moves browser detection/strategy templates under fragments/bankid/browsers and updates parsers accordingly.
  • Adds a new feature flag for the consentor flow ($bankidConsentorLaunchVersion2) and integrates the shared fragments when enabled.

Reviewed changes

Copilot reviewed 10 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/identity-server/templates/core/settings.vm Documents the new consentor launch-v2 flag (commented example override).
src/identity-server/templates/core/settings-defaults.vm Adds default value for the new consentor launch-v2 flag.
src/identity-server/templates/core/fragments/bankid/check-platform-capabilities.js.vm Updates parse paths to use the new shared browser strategy/detections fragments.
src/identity-server/templates/core/fragments/bankid/browsers/browser-strategy.js.vm Adds shared BrowserStrategy and launch helpers used by browser detection templates.
src/identity-server/templates/core/fragments/bankid/browsers/available-browser-detections.vm Updates browser detection includes to new shared fragment locations.
src/identity-server/templates/core/fragments/bankid/browsers/*.js.vm Adds individual browser strategy entries (iOS/Android) for detection/launch behavior.
src/identity-server/templates/core/fragments/bankid/bankid-poller.vm Refactors poller into a shared fragment with injected settings and optional POST payload support.
src/identity-server/templates/core/fragments/bankid/bankid-app-launcher.vm Refactors app launcher into a shared fragment driven by injected polling settings.
src/identity-server/templates/core/authenticator/bankid/launch/index.vm Switches BankID launch-v2 flow to shared poller/app-launcher fragments and adds settings parse.
src/identity-server/templates/core/authenticator/bankid/launch/bankid-polling-settings.vm Adds authenticator-specific polling settings (selectors and callbacks).
src/identity-server/templates/core/consentor/bankid-signing-consentor/bankid-poller.vm Adds consentor feature-flag branch to use shared poller/app-launcher and new consentor settings.
src/identity-server/templates/core/consentor/bankid-signing-consentor/bankid-polling-settings.vm Adds consentor-specific polling settings (selectors, callbacks, POST body).
Comments suppressed due to low confidence (3)

src/identity-server/templates/core/fragments/bankid/bankid-app-launcher.vm:77

  • The cancel handler only calls pollingSettings.onCancelButton() when cancelFunction() returns true. For flows where the cancel element does not submit naturally (e.g. the consentor flow uses a type="button"), a false return from cancelFunction() will prevent cancellation entirely. Consider always invoking onCancelButton() (and use cancelFunction() only to stop polling), or ensure cancelFunction() always returns true.
    src/identity-server/templates/core/fragments/bankid/bankid-poller.vm:90
  • In the 201 response handler, data.message.redirectUrl is accessed without first checking that data.message exists. If the backend returns a 201 payload without a message object (e.g. only stopPolling), this will throw and break polling. Guard with data.message && data.message.redirectUrl before dereferencing.
    src/identity-server/templates/core/fragments/bankid/bankid-poller.vm:25
  • The header comment says se.curity.bankid.pollingSettings must be defined before this fragment is parsed, but this fragment only defines se.curity.bankid.Poller and the settings are passed in when constructing the Poller (and in current usage the polling-settings fragment is parsed after this one). Please update the documentation to reflect the actual dependency/order to avoid confusing integrators.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

* Factorize BankID authenticator polling logic Version 2 in shared fragments
* Use polling logic Version 2 in BankID signing authenticator, based on a feature flag (bankidConsentorLaunchVersion2). Old polling logic remains the default one.
@phylexm phylexm force-pushed the feature/dev/IS-10603-bankid-consentor-update-polling-logic branch from b778bb3 to 8046e90 Compare March 17, 2026 12:10
@phylexm phylexm merged commit 0ab25e1 into dev Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants