Skip to content

Bug: Unable to correctly obtain the user's FID in Base Mini App #2546

@LingTaixu

Description

@LingTaixu

Describe the bug and the steps to reproduce it

    await sdk.actions.ready();
    await sdk.context.then((ctx: any) => {
      signIn();
      console.log(ctx, 'ctx');
      setContext(ctx);
    });
{
    "user": {
        "fid": -1,
        "username": "dummyaccount",
        "displayName": "dummy testing account",
        "pfpUrl": "https://farcaster.xyz/avatar.png"
    },
    "client": {
        "clientFid": 309857,
        "added": false,
        "platformType": "web",
        "safeAreaInsets": {
            "top": 0,
            "bottom": 34,
            "left": 0,
            "right": 0
        }
    }
}

Error

AuthClientError: Valid FID is required for Sign In with Farcaster

in farcaster

{
    "user": {
        "fid": 1501133,
        "username": "letooo",
        "displayName": "letooo",
        "pfpUrl": "https://imagedelivery.net/BXluQx4ige9GuW0Ia56BHw/6793598c-8068-49d9-986b-6f417e4fd300/rectcontain2",
        "location": {
            "placeId": "",
            "description": ""
        }
    },
    "client": {
        "platformType": "web",
        "clientFid": 9152,
        "added": false
    },
    "features": {
        "haptics": false,
        "cameraAndMicrophoneAccess": false
    }
}

What's the expected behavior?

No response

What version of the libraries are you using?

    "@coinbase/onchainkit": "^1.1.2",
    "@farcaster/miniapp-sdk": "^0.2.1",
    "@farcaster/quick-auth": "^0.0.8",

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