Does a user get created on Auth0 Access Token Calls

I have my Directus instance setup so that it connects to Auth0. So that works.

I also have it setup so that AUTH_AUTH0_ALLOW_PUBLIC_REGISTRATION = true.

I can confirm this because if I login with Auth0, a new user is created.

However, I’m also trying to have my NextJS app get an access token to do GraphQL queries to my Directus app. When I do this though, I’m always met with “Invalid Credentials”. My thought is that my query is not enough to trigger a new user creation.:

    const accessToken = await auth0.getAccessToken()
    const client = new GraphQLClient(`${process.env.DIRECTUS_URL}/graphql`, {
        headers: {
            Authorization: `Bearer ${accessToken.token}`, // optional if needed
        },
    });

Anyone know whether or not this is how it’s supposed to work or perhaps I’m missing something?

For those wondering for the future. Directus does NOT create a client on GraphQL queries even with a valid access token. Users are only created if you log in from the auth//login endpoint.

However, my workaround was to add a snippet of code in the getAccountabilityForToken function to use the external auth ID to identify the user when a valid access token is provided.