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
- Custom Domains with Cloudflare for SaaS ...
Hi! I'm using Appwrite Cloud Sites with Cloudflare for SaaS for multi-tenant custom domains. Problem: Custom domain: donate.pekeetong.my → CNAME to sites.dono...
- [SOLVED] Get Relations when using Tables...
Hi there, I have a table containing a relation column with a one-to-many relationship to another table. When Using TablesDB.GetRow in "node-appwrite" i get all ...
- Transaction and Session
I've been debugging for hours a problem that now I think it's because It's not allowed: In my project a user log in using the `node-appwrite` SDK (SSR) I store...