Back

Session - Rate Limit

  • 0
  • Users
  • Web
Belisarith
25 May, 2023, 21:07

I am developing a fun little side-project using this great Baas. I am using react and wrote a hook to get a session (currently with a fake user/password hard coded for development, will incorporate correct login later on). However, during development I am refreshing the app pretty often and I always get a new session. After a few times, the rate limit kicks in. Am I doing something wrong. Can I somehow disable the rate limit - btw. I am hosting appwrite in my homelab and I see no problem currently with unlimited requests, because this application is not open to public.

TL;DR
To avoid hitting the rate limit, instead of creating a new session each time, use the `account.get()` method to check if the user has logged in previously and if a session already exists. This way, you can save the session in local storage and retrieve it when needed. However, note that if you're using Appwrite cloud for the Hackathon, you cannot disable the rate limit. If you're self-hosting Appwrite, you can disable it.
D5
25 May, 2023, 21:20

Why not saving the session?

D5
25 May, 2023, 21:25

If self-hosted, yes, you can disable rate limit. If you're in cloud, not possible (note that for the Hackathon you need to use appwrite cloud and not self-hosted)

Belisarith
25 May, 2023, 21:37

You mean saving the session in local storage somehow?

Can you give me a hint, how to disable the rate limit?

D5
25 May, 2023, 22:25

Use account.get() to see if user has logged in previously and a session already exists

D5
25 May, 2023, 22:26

Instead of always creating a new sesion

inno
6 Jun, 2023, 07:55

@DS I figured this one out of you still need help

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