Skip to content

[Bug]: Tighten magic-link verification lifecycle cleanup #23

@Bccorb

Description

@Bccorb

What happened?

The magic-link verification screen creates async resources inside an effect but does not fully clean them up:

  • BroadcastChannel
  • redirect setTimeout

This is a small but worthwhile hardening task.

Current behavior

In src/views/VerifyMagicLink.tsx:

  • a BroadcastChannel is created after successful verification
  • a timeout is scheduled to redirect the user
  • neither resource is explicitly cleaned up on unmount

Steps to Reproduce

Send a magic link, click the link to verify, not the broadcast is still mounted.

Expected Behavior

Acceptance criteria

  • No unclosed BroadcastChannel remains after component unmount
  • Redirect timeout is cleared on unmount
  • Success flow still posts the success message and redirects correctly
  • Error and missing-token cases still behave correctly

Environment

No response

Logs / stack traces

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions