React SDK example - nothing in the userInfo but tid and sub
-
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?