Support asynchronous origin function
We want to use origin function in InputAppInfo as described in https://supertokens.com/docs/emailpassword/common-customizations/multiple-clients.
Our logic is to download current origin list from our database using Django ORM. However, currently this is not possible because of the exception: django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async
Wrapping the ORM part with sync_to_async will make the whole function asynchronous but then it must be handled correctly by supertokens (using await keyword). The only solution is to update this repo to handle asynchronous origin function.
hey @aprilis this is a good suggestion. In the meantime though, you can load up the list of origins from the database / refresh them in the background periodically and then read from the in memory list.