-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide user authentication information on 'account.create' event #1373
Comments
As of right now, we are only passing the JWT if the function was executed by the user itself. But I can understand how in this particular case it could be really beneficial. This is also where the problem is then - it would be completely out of the ordinary and wouldn't follow any structure to have a JWT with only this call by an event. Can you think of any more events where this might be nice to have? Maybe all |
How much trouble would it be to pass the JWT for each event? I feel like that would be the most consistent and easy to understand. Also having that JWT always accessible doesn't do any harm, does it? |
Agreed, I'm currently trying to conduct email verification checks using the on session create event to trigger a function but the JWT isn't set. Having the JWT available for all account events could help other use cases too. |
In Appwrite 1.5, it's now possible to create a session for a user server-side so you can do this and then have a session to call the |
🚀 Feature
I'm trying to achieve the following: When a user creates an account I want the verification email to be sent by a server side function and not from within the client side callback.
Have you spent some time to check if this issue has been raised before?
I've used Google and discussed the issue with @eldadfux on Discord. As far as I can tell this has not yet been proposed or discussed.
Have you read the Code of Conduct?
Yes.
Pitch
For this to work one needs to set a valid JWT for the user inside of the function. The JWT is provided through the 'APPWRITE_FUNCTION_JWT' environment variable.
Currently the 'account.create' event does not set this variable since the user it not authenticated when account.create() is called.
Here's the code I'm deploying as a function:
Currently process.env.APPWRITE_FUNCTION_JWT is 'null'.
This can also come in handy in other scenarios.
The text was updated successfully, but these errors were encountered: