Back

Invalid UserId params

  • 0
  • Auth
Ak_2023
30 Jul, 2024, 21:42

async createAccount({email, password, name}) { try { const userAccount = await this.account.create(ID.unique(), email, password, name); if (userAccount) { return this.login({email, password}); } else { return userAccount; } } catch (error) { throw error; } }

TL;DR
Developers are encountering an "Invalid UserId params" error when the parameter exceeds 36 characters or contains invalid characters. Check for similar posts in support first. The issue might stem from importing ID from appwrite. Additionally, the error "createEmailSession is not a function" may occur due to rate limits. Mitigate this by waiting out the time frame or staying within the request limit.
Ak_2023
30 Jul, 2024, 21:43

plus i am getting Rate limit for the current endpoint has been exceeded. How to resolve it

Kenny
30 Jul, 2024, 21:47

The only resolve if using cloud is to wait out the rate limit time.

Kenny
30 Jul, 2024, 21:47

What user id is it sending? You should be able to see this in the network request

Kenny
30 Jul, 2024, 21:48

You get 10 requests per 60 minutes from the same IP + URL

Ak_2023
30 Jul, 2024, 21:49

66a957bf00091079bd45

Ak_2023
30 Jul, 2024, 21:49

this is one of the userId

Kenny
30 Jul, 2024, 21:50

What is the function login

Ak_2023
30 Jul, 2024, 21:50

async login({email, password}) { try { return await this.account.createEmailPasswordSession(email, password); } catch (error) { throw error; } }

Ak_2023
30 Jul, 2024, 21:51

before i was using just createSession

Ak_2023
30 Jul, 2024, 21:51

but when i switched to createEmailPasswordSession it started showing rate limit

Ak_2023
30 Jul, 2024, 21:52

plus i want to ask one more thing why it was showing createEmailSession is not a function

Kenny
30 Jul, 2024, 21:52

Because it's not?

Kenny
30 Jul, 2024, 21:53

Are you importing ID from appwrite?

Ak_2023
30 Jul, 2024, 21:54

yeah

Kenny
30 Jul, 2024, 21:55

Do you have the error it's throwing in the console? Does it have a stack trace?

Ak_2023
30 Jul, 2024, 21:56

Invalid userId param: Parameter must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char

Ak_2023
30 Jul, 2024, 21:56

i guess you are asking this.

Kenny
30 Jul, 2024, 21:58

Did you do any searching in support before posting the question? Looks like you got your code from a tutorial or something? Seeing a lot of people with the same code and problem

Kenny
30 Jul, 2024, 21:58

Look at one of those posts

Ak_2023
30 Jul, 2024, 21:58

no i didn't search anything before

Ak_2023
30 Jul, 2024, 21:58

yeah its from a tutorial

Kenny
30 Jul, 2024, 21:59

Search for your error in support, you'll find others with the exact same code

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