Following https://appwrite.io/docs/references/cloud/server-nodejs/users#createSession Here is my code sample: try { const response = await users.create(ID.unique(), email, phone); const session = await users.createSession(response.$id); return Response.json({ success: true, message: "User created successfully!", user: response, session: session }); } catch (AppWriteError: unknown) { const error = AppWriteError as AppwriteException;
return Response.json({
success: false,
message: error.message,
user: null
});
}
How to create a session for the newly created user? I know creating account will make a session, but I need to create users with email and phone.
Thanks
Recommended threads
- Anyone manage to get a slack-bot working...
I'm trying to setup a bot the send and retrieve slack messages to a chat in my site. I've failed with SSE and appwrite functions soo far... i'll trying polling ...
- restore backup on another server with an...
I managed to restore DB+Volumes from a server to another one with another domain but when I try to click my project on the console, I get error "404 - Project w...
- [Sites] Deployment finished but site is ...
The deployment finished and is active but the site shows timeout error.