When running the function it returns ”Error: User with the requested ID could not be found.”, according to the docs it should create a new user "If the provided user ID has not be registered, a new user will be created."
Function Code:
https://text.is/KLKW
Error: User with the requested ID could not be found.
at new AppwriteException (/usr/local/server/src/function/node_modules/node-appwrite/lib/exception.js:3:9)
at <anonymous> (/usr/local/server/src/function/node_modules/node-appwrite/lib/client.js:101:36)
TL;DR
Custom token function is not creating new users as expected, resulting in error "User with the requested ID could not be found." Check the function code and ensure it is correctly handling the creation of new users.