Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate user object when there was an existing user in the linked user object. #20

Open
JohnVersus opened this issue Jan 23, 2023 · 1 comment

Comments

@JohnVersus
Copy link

New Bug Report

Checklist

Issue Description

This issue is applicable in a specific scenario when there are 2 user wallets linked using Moralis.link with the parse server.
Let's say we have successfully linked wallet 2 with wallet 1. Now when we try to authenticate with wallet 1 again it it creates a duplicate user object in _user class instead of using the existing user object.

Steps + code to reproduce

This is happening when v1 sdk is used with parse server

  1. Authenticate with user wallet 1.
  2. Link user wallet 2 using Moralis.link function.
const unsub = Moralis.onAccountChanged(async (account) => {
      const confirmed = confirm("Link this address to your account?");
      const { message } = await Moralis.Cloud.run("requestMessage", {
        address: account,
        chain: "0x1",
        networkType: "evm",
      });
      if (confirmed && account) {
        await Moralis.link(account, {
          signingMessage: message,
        });
      }
    });
  1. Logout from the current user session linked to wallet 2.
  2. Authenticate with user wallet 1 again.

If we check the parse dashboard now you should see two user objects for wallet 1.

Actual Outcome

Duplicate user object is created even when there is an existing user object.
image

Expected Outcome

Existing user object should be reused when we re-authenticate with wallet 1

Environment

Server

  • Moralis server version: Self-hosted server

Client

  • Moralis SDK version: "moralis-v1": "^1.12.0",
  • Operating system: not applicable
  • Browser: not applicable

Logs

@bskrksyp9
Copy link

+1

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

No branches or pull requests

2 participants