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?