Rank 2: Process
its only containing userId
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
its only containing userId
Admin
Yes, that's as expected because that's the schema for a session object
Admin
I deleted your payload because it contained sensitive data
Rank 2: Process
i needed email and name also which is associated with the gmail login
Rank 2: Process
its not coming there
Admin
You can use the userId attribute and then fetch the user
Rank 2: Process
using Accounts API right
Admin
Users since you're server side
Rank 2: Process
Oops got it
Rank 2: Process
Thanks
Rank 2: Process
Will try this
Rank 2: Process
Also I see in console functions deployment and executions both are sorted in wrong direction it should be descending order by latest created on first row. Is there any issue already ?
Admin
This is expected for now. We noticed bad performance sorted descending. We're working on it
Rank 2: Process
Ok thanks.
Rank 2: Process
Also cloud function is working fine now on google sign in as well using session create event. Thanks for the help
Rank 2: Process
@Steven one issue is there i noticed like when i am signing in with google or creating account using signup with email and password
Rank 2: Process
cloud function is not running instantly and because of that in UI am not able to see user info as i am fetching it from custom collection for about 30-50 seconds
Rank 2: Process
Maybe i will have to do all this in client side storing user in custom collection after user signup or login with google. What do you think ?
Admin
How long is the delay?
Rank 2: Process
max 15-25 seconds i believe
Admin
I'll have to check things on Monday
Rank 2: Process
I ran it now again it toom around 30 seconds
Rank 2: Process
took*
Admin
that's odd..it runs pretty quick for me. do you have other functions that process the same event?
Admin
code:
module.exports = async function (req, res) { const data = JSON.parse(req.variables['APPWRITE_FUNCTION_EVENT_DATA'] ?? '{}'); res.json({ createdAt: data['$createdAt'], updatedAt: data['$updatedAt'], now: (new Date()).toISOString(), data: data });};output:
{ "createdAt": "2023-06-13T17:03:17.466+00:00", "updatedAt": "2023-06-13T17:03:17.466+00:00", "now": "2023-06-13T17:03:17.540Z", "data": { "$id": "test", "$createdAt": "2023-06-13T17:03:17.466+00:00", "$updatedAt": "2023-06-13T17:03:17.466+00:00", "name": "Test", "password": "", "hash": "argon2", "hashOptions": { "memoryCost": 2048, "timeCost": 4, "threads": 3 }, "registration": "2023-06-13T17:03:17.466+00:00", "status": true, "passwordUpdate": "", "email": "test@example.com", "phone": "", "emailVerification": false, "phoneVerification": false, "prefs": [] }}