
I have a secondary server where I do some work can i check in that server that the request to that server is sent by a logged in Appwrite user

You could send the user's JWT token to your server

that expires in 15 min should I send a new JWT with each request

users sessions can last long

What is the recommended whay to work around it

What's your stack? Can you provide some more detail on your setup?

yeah I have an endpoint which makes videos and run some long running processes . I want to put it on my server so that I can use a GPU it is a Python Django backend I have everything else integrated in appwrite how can I check that the request to this long running endpoint is snt by appwrite user.

I user Python Django for ruuning the GPU servers on AWS.

Do you use your Django backend for anything else?

No

Is the original request coming from a client side SDK?

yes

In that case, you can just run a quick check from the client side and only send that request if the user is authenticated so the server wouldn't get this request from unauthenticated users. Then to retrieve the user, you can just use the users API on the server and get the user by ID:
users.get('[USER_ID]');

Basically, the auth check happens on the client. So you can take advantage of the long lasting session.

Steven's suggestion of a JWT would also should work. Just generate a JWT on each request and send it to verify auth status. The short lived token shouldn't be an issue.

I would just use the JWT

Generating a new JWT on each request is not a problem right
because checking if the user is authenticated from client and only sending the request I will have to keep my server endpoint unauthenticated which I can't do because using GPU so it can be expensive

How often will you be making these request?

at max 2-3 time/15 min

Just curious if its every couple of seconds or maybe only a few times a day per day

Per user?

yeah
Recommended threads
- Sharing cookies
Hi, I’m using Appwrite Cloud, and I have a setup where my Appwrite backend is hosted on a subdomain (e.g., api.example.com), while my frontend (Next.js app) and...
- Organization not exists anymore
Hello! We have a problem with a cloud database. We are on the Free plan, but after a refresh the site wants me to create a new organisation, and I not see the c...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
