Back

[SOLVED] Rate limit for server-side code

  • 0
  • Accounts
  • GraphQL
  • Web
  • Cloud
debashish
17 Oct, 2023, 20:18

I'm using a server (nextjs api route) to create a user account using a graphql mutation query (accountCreate); however, because the account is created from the server rather than the actual user system, appwrite believes the same user is attempting to create an account multiple times and throws an error saying "The rate limit for the current endpoint has been exceeded." Please try again after some time ." Despite the fact that I attempted to create the account from a different IP address. its just that i am using next api gateway. It was displaying the same error. can you suggest a solution.

TL;DR
User is experiencing a rate limit issue when trying to create a user account using a GraphQL mutation query (accountCreate) on a server. Appwrite believes the same user is creating multiple accounts and throws a rate limit error. The user tried creating the account from a different IP but still encountered the error. The solution is to use an API key and the users API instead of the create account API.
Drake
18 Oct, 2023, 00:30

you might need to use an api key and the users api

debashish
18 Oct, 2023, 10:15

Can you please elaborate which api key you are reffering to. and if u can point to docs if there any for the same that would be great. I have also attached the screenshot of code snippet i am writing in my proj.

debashish
18 Oct, 2023, 10:15
debashish
18 Oct, 2023, 10:37

and when I add "X-Appwrite-Key" to the header it gives another

error. { "error": "app.64daf210b8ce242c8fbb@service.cloud.appwrite.io (role: applications) missing scope (public): {response:{errors:[{message:app.64daf210b8ce242c8fbb@service.cloud.appwrite.io (role: applications) missing scope (public),extensions:{category:appwrite},locations:[{line:4,column:5}],path:[accountCreate]}],data:{accountCreate:null},status:200,headers:{}},request:{query:n nmutation {n accountCreate(n userId: unique(),n email: test23@test.com,n password: 1234567890n ) {n _idn _createdAtn _updatedAtn namen registrationn statusn labelsn passwordUpdaten emailn phonen emailVerificationn phoneVerificationn prefs {n datan }n accessedAtn }n}nn ,variables:{}}}" }

Drake
18 Oct, 2023, 16:31

you wouldn't be calling the create acocunt api. you would use the create user api.

debashish
18 Oct, 2023, 16:42

thanks.. its working..

Drake
18 Oct, 2023, 21:39

[SOLVED] Rate limit for server-side 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