Skip to content

Generate the QR-code on the client using Javascript #394

@PeterOrneholm

Description

@PeterOrneholm

Is your feature request related to a problem? Please describe.
Right now we are generating the QR-code serverside by implementing IBankIdQrCodeGenerator, by default that is done using the QRCoder library. The interface expects you to return the generated QR code as a Base64 encoded PNG-file that is then transported to the client and displayed to the user.

As the image is refreshed quite often (every second) this could cause timing issues (as the QR-code only have a limited lifespan, it is important that it reaches the client right on time). We should look at having the possibility (and make that the default option) to just return the content for the QR code and then tender it on the client using some kind of JS-lib.

What area is it related to
UI

Describe the solution you'd like
Change the IBankIdQrCodeGenerator so that it, in addition to the content, also returns some content type (png/svg etc). Then make the server side rendering optional, set it as an option. Either way, the raw content of the QR code should always be sent to the client to allow for it to render the code itself.

A few ideas on JS lib can be found here:
https://medium.com/geekculture/few-ways-to-generate-qr-code-using-javascript-54b6b5220c4f

We would need to think about how to solve this, without taking a hard dependency on a third party lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions