appwrite: π Bug Report: Unable to get current user session on functions using jwt
π Reproduction steps
import { Client} from 'node-appwrite';
const userClient = new Client();
const userAccount = new Account(userClient);
userClient.setEndpoint(FUNCTIONS_END_POINT)
.setProject(PROJECT_ID)
.setJWT(x-appwrite-user-jwt);
const currentSession = await userAccount.getSession('current');
π Expected behavior
getSession(βcurrentβ) should return the current user session that is being used.
π Actual Behavior
Fails with user_session_not_found error.
{"code":404,"type":"user_session_not_found","response":{"message":"The current user session could not be found."...}},
π² Appwrite version
Appwrite Cloud
π» Operating system
Linux
π§± Your Environment
1.5.5
π Have you spent some time to check if this issue has been raised before?
- I checked and didnβt find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 16 (8 by maintainers)
No worries at all! Feel free to come back when you find the time ππΌ
@Souptik2001, assigned! Thanks for your interest! ππΌ
@nickaldwin, the sooner the better. Please keep us updated on your progress. Otherwise, Iβll need to unassign you.
@nickaldwin, have you looked through these docs?
That said, you donβt even need to use an Appwrite function for this. You should be able to use a client SDK to
Then, use a server SDK to set the JWT token and call Get session using βcurrentβ as the ID