Custom User Data unavailable with Custom JWT auth

I’m working on an app that currently uses email/password auth. I’m thinking of switching to using the custom JWT auth for various reasons. I’m quite extensively using the custom user data to store all sorts of things. When I switch from email/password to custom JWT the login works, but the custom user data is empty…

This works fine:

const jwt = await"https://MYAPI.COM/login", {
          user: email.value,
          password: password.value,
        console.log(`jwt: ${JSON.stringify(}`);
        const credentials = Realm.Credentials.emailPassword(
        // const credentials = Realm.Credentials.jwt(;
        console.log("logging in");
        const user = await realm.logIn(credentials);
        await user.refreshCustomData();
        const customUserData = await user.refreshCustomData()
        console.log(`Logged in as ${JSON.stringify(user)}`);
        console.log(`customUserData: ${JSON.stringify(customUserData)}`);

When I uncomment the line changing the credentials the custom user data is empty