Back

[SOLVED] Having this error while creating a team membership

  • 0
  • Accounts
ianmont
29 Apr, 2023, 20:10

Im trying to create a new team membership, and is throwing me this error "AppwriteException: Invalid email: Value must be a valid email address".

what im doing wrong? I attached a photo of my code, thanks

TL;DR
The user is encountering an error while creating a team membership. The error message states that the value must be a valid string and between 1 and 8192 characters long. They are also trying to figure out how to add a team member without requiring them to confirm via email. Solution: 1. Change the payload to be a JSON string. 2. Use a server SDK and API key to create a team membership without an email confirmation. 3. Make sure to pass the correct parameter (email instead of username) when creating a team membership. 4. Check the version of Appwrite being used and the version of the web or
ianmont
29 Apr, 2023, 20:11
Drake
29 Apr, 2023, 20:21

Some questions:

  1. What version of Appwrite are you on?
  2. Are you using the web or node SDK?
  3. What version of the SDK are you using?
ianmont
29 Apr, 2023, 21:31

Appwrite Version 1.3.1

Im using the web sdk with reactjs and the package version is:

"appwrite": "^11.0.0"

Drake
29 Apr, 2023, 21:37

The last parameter you're passing in is the email field, but you're passing a username. See https://github.com/appwrite/sdk-for-web/blob/7b37a2bec1dbe47b55e2c962996046f56b763192/src/services/teams.ts#L233

ianmont
29 Apr, 2023, 23:09

It seems to work, only now I get the smtp error because I don't have it configured.

Is there a way that I can create a new team membership for a user without having to email them and have them accept it?

Like to force the member to join my team without any invitation, example: I create a new team membership for a user and their entry into the team is automatically confirmed, so I don't have to send them an email and do the update to confirm that the user is in the team once they click the email, etc... like just force it to join the team

Drake
29 Apr, 2023, 23:14

Use a server SDK and an API key

ianmont
1 May, 2023, 02:54

Im checking the server SDK docs but I can't find a way to not pass the url and manage to enter a user without making him confirm via email, how can i do it?

Drake
1 May, 2023, 03:15

Pass some url

ianmont
1 May, 2023, 19:08

Im using a function to add the team member.

Im passing all my data needed to the function on a object. But when executing the console throws me this error: "AppwriteException: Invalid data: Value must be a valid string and at least 1 chars and no longer than 8192 chars"

Its like its expecting to be a simple string

ianmont
1 May, 2023, 19:08
ianmont
1 May, 2023, 19:08

And my code looks like this:

ianmont
1 May, 2023, 19:09

How can i make the payload an object or how i can send all my props to the function?

Drake
1 May, 2023, 19:11

convert the object to a JSON string

ianmont
1 May, 2023, 19:46

it worked

ianmont
1 May, 2023, 19:46

thanks

Drake
1 May, 2023, 19:47

[SOLVED] Having this error while creating a team membership

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