FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    React SDK example - nothing in the userInfo but tid and sub

    Scheduled Pinned Locked Moved
    General Discussion
    1
    1
    1
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jw 0
      last edited by

      I'm sure I'm doing something stupid here but I can't work out what I haven't done.

      I am using the changebank React SDK example as my test harness, using the community version of FusionAuth for now, hosted under docker
      I've created a new tenant, a new app and then a new user.
      I can login using this new user into the app but the userInfo structure has nothing in it other the the use sub and the tid.

      Config is below

      const config: FusionAuthProviderConfig = {
      clientId: "31067471-23fc-4634-afa9-c049ff4f0a86",
      redirectUri: "http://localhost:5173",
      serverUrl: "http://localhost:9011/",
      shouldAutoFetchUserInfo: true,
      shouldAutoRefresh: true,
      onRedirect: (state?: string) => {
      console.log(Redirect happened with state value: ${state}"});
      }
      };

      Example code is:
      In main.tsx
      const { isLoggedIn, isFetchingUserInfo, userInfo } = useFusionAuth();

      In the AccountPage.tsx I have:

          <p>tid {userInfo?.tid}</p>
          <p>sub {userInfo?.sub}</p>
          <p>roles {userInfo?.roles}</p>
          <p>email {userInfo?.email}</p>
      

      The roles and email fields are always null

      Any ideas?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Looks like your connection to FusionAuth Forum was lost, please wait while we try to reconnect.