Skip to content

[Synkronus Portal] Show Formulus onboarding QR in portal after user creation (and admin password reset) #694

Description

@najuna-brian

Description

When an admin creates a new user (or force-resets their password), the portal should display a downloadable Formulus QR code containing the server URL, username, and plaintext password. This removes the need to run synk qr or formulus/scripts/generateQR.ts manually and lets the admin copy/send credentials to the user in one step.

The QR must only be shown at the moment the plaintext password is still known - it must not be stored or retrievable later.


Problem

Today, onboarding a Formulus user requires:

  1. Creating the user in the Synkronus Portal (synkronus-portal)
  2. Separately generating a QR code via the CLI (synk qr) or the Formulus script (npm run generate_qr)

That extra CLI step is awkward for admins who already work in the portal. After user creation, the portal only shows a success toast and closes the modal, the plaintext password is discarded immediately:

The same applies to admin password reset (handleResetPassword): success message, form cleared, modal closed — no QR.

On the backend, passwords are hashed on create/reset and never returned again, which is correct for security:


Proposed solution

After a successful Create User or Admin Reset Password action, show a one-time success screen/modal that includes:

  • Username
  • Password (plaintext, shown once — same security model as today, but surfaced briefly for handoff)
  • QR code image encoding FRMLS settings for Formulus
  • Download QR button (PNG)
  • Clear copy explaining this is shown once and cannot be retrieved later

When to show the QR

Event Show QR?
Admin creates a new user Yes
Admin force-resets a user's password Yes
User changes their own password No
Viewing an existing user later No

Security constraints (non-negotiable)

  • QR contains the unencrypted password (required by Formulus scan flow).
  • Because passwords are hashed server-side and never stored in plaintext, the QR can only be generated client-side while the plaintext password is still in memory from the form submission.
  • The QR/password must not be persisted in localStorage, sessionStorage, the backend, or any user record.
  • Closing/dismissing the modal should discard the credentials from React state.
  • No API endpoint should ever return or regenerate a user's plaintext password.

QR image generation

Include the CLI’s logo overlay (qr_logo.png) though functional QR is the priority.


Acceptance criteria

  • After creating a user, admin sees a one-time screen with username, password, and scannable QR.
  • After admin password reset, admin sees the same one-time screen for that user.
  • Admin can download the QR as a PNG.
  • Dismissing the screen clears credentials from memory; revisiting the user list does not show the QR again.
  • QR payload is valid FRMLS v1 and works when scanned in Formulus Settings → Scan QR code.
  • Own-password change flow is unchanged (no QR shown).
  • No backend storage or API for plaintext passwords.

Test plan

  1. Create a new user in the portal → confirm QR appears, scan with Formulus → app configures server URL + credentials and can log in.
  2. Reset a user’s password as admin → confirm QR appears with the new password; old QR/password no longer works.
  3. Close the success modal → reopen user management → confirm QR/password are not shown again.
  4. Change own password as a non-admin → confirm no QR is shown.
  5. Download PNG → confirm file scans correctly in Formulus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededuiFor issues related to user interface components, layout, styling, and front-end interactions.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions