Skip to content

dedicatedWalletConnector removes all query string from URL when not authorized #51

@williamchong

Description

@williamchong

Describe the bug

As long as dedicatedWalletConnector is used in wagmi config and user is not already authorized, the parent site's URL query string will always get wiped due to calling magic.oauth.getRedirectResult()

Related code
https://github.com/magiclabs/wagmi-magic-connector/blob/9885e1b939f5e1ecce3b27f0ce5fcad68026d41f/src/lib/connectors/dedicatedWalletConnector.ts#L277C24-L277C61
https://github.com/magiclabs/magic-js/blob/23e89d08ba5fb9b891732c478f42cf4258cb78aa/packages/%40magic-ext/oauth/src/index.ts#L38

To Reproduce
Steps to reproduce the behavior:

  1. Integrate wagmi with dedicatedWalletConnector
  2. Open the site with some qs, e.g. ?a=b without connecting to any wallet
  3. Observe all query string e.g.?a=b disappear

Expected behavior
Keep parent site's query string untouched, at least when oauth is not enabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions