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...
[SOLVED] Why only 15 min validity.
Votes
0
Replies
24
Participants
Unknown
Messages
25
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
Rank 2: Process
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
Rank 2: Process
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?
Rank 2: Process
I am using RTK query on frontend.. and graphql-request on server.
Rank 2: Process
basically i send the query to server and server makes the call the appwrite
Rank 2: Process
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.
Rank 2: Process
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?
Rank 2: Process
Rank 2: Process
this above code is in server.. the response i get is the appwrite session object
Rank 2: Process
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
Rank 2: Process
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
Rank 2: Process
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.
Rank 2: Process
yeah.. will go through this doc. thanks.. for the guidance.
Rank 2: Process
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
Rank 2: Process
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.