Typescript - how to infer additional, non-database fields during registration
Hi everyone,
I'm implementing the email credential flow.
When signing up, I want the user to also specify a
registrationToken
similar to how matrix.org (decentralised chat client) does it.
This registrationToken
should not be stored in the database (it's used strictly during the sign up process).
The code I've written works fine, but I can't find from the docs a way to remove the type error - could you please provide some guidance?
Thank you!


3 Replies
After some investigation, I discovered that the following hack/workaround can be used to remove the type error:
Note: if we instead follow the docs and use
to try to sync with the server auth types, the hack for
registrationToken
will no longer work (it gets ignored). Is there a better way?
Is there a better way?Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
The issue is,
registrationToken
is not a user field to be stored in the database and won't be inferred - it's a variable that the frontend submits to the backend, solely for the purpose of comparing against the backend's REGISTRATION_TOKEN variable (similar to how a matrix server would require one to register)