Back

Error: Invalid document structure: Missing required attribute "expire"

  • 1
  • Functions
be4st
22 Jun, 2024, 09:17

I get an error message when i try to create a session of new user.

TypeScript
const users = new Users(client)

const user = await users.create(
  ID.unique(),
  email, 
  phone, 
  password, 
  name
)

const session = await users.createSession(user.$id)
TL;DR
Developers are encountering an error message stating "Invalid document structure: Missing required attribute 'expire'" when creating a session for a new user due to a missing attribute. Make sure to include the required attribute "expire" when creating a session to resolve the error.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more