Im not sure how that will solve your problem....but you can look at the rest api docs or something to see what the API call is to generate a JWT...
You're very hung up on using a JWT token, but that's not the primary way Appwrite handles sessions...
In Appwrite the JWT token is used to let a user (who already has a session) grant something else access to make requests on behalf of the user for a short period of time
I am just trying to avoid the usage of web SDK. and acheive it through graphql query.
That's fine...it's all the same API
how when I create a session using createEmailSession query. i get the session. but when I try to get the account details i get this error "(role: applications) missing scope (account)."
What are you using to make the API call? Apollo or something?
I am using RTK query on frontend.. and graphql-request on server.
basically i send the query to server and server makes the call the appwrite
and whtever response i receive back on server. i send it back to client. reason being i am trying hide the base url of appwrite on frontend.. for security reasons.
i am also using nextjs auth. for session
So the response from Appwrite should include some headers and cookies. Are those being used for the subsequent request?
this above code is in server.. the response i get is the appwrite session object
line 42 in the screenshot
That's just metadata about the session object. It is not the actual session
The session is in the cookie or fallback header
okay.. how can i can get the cookie. because above code is the first step to login.
I don't know the library you're using
There should be a cookie and/or a fallback header. Read through this page: https://appwrite.io/docs/apis/rest#authentication
I know it says rest but it's all the same
sure.. I am just using NEXT js, RTK query to make graphl query. not using anything. else . If there is any exisiting project which you have link. which is used without the web sdk.. that would be great too.
yeah.. will go through this doc. thanks.. for the guidance.
I was facing the same problem and i decided to use client-sdk on server-side (Graphql). You only have to create session via REST. Or you can use appwrite-ssr npm pck
its fixed now. I am able to make graphql query request passing the session correctly .. the catch is u receive the session as part of the response headers.
[SOLVED] Why only 15 min validity.
Recommended threads
- Having issues with login via CLI
``` ~/appwrite appwrite login --endpoint https://localhost/v1 --verbose ? Enter your email myvalidemai...
- delete document problems
i don't know what's going on but i get an attribute "tournamentid" not found in the collection when i try to delet the document... but this is just the document...
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...