appwrite/appwrite

馃悰 Bug Report: Unable to get current user session on functions using jwt

Open

#8174 opened on May 21, 2024

View on GitHub
聽(17 comments)聽(0 reactions)聽(1 assignee)TypeScript聽(56,074 stars)聽(5,346 forks)batch import
bughelp wantedproduct / auth

Description

馃憻 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?

Contributor guide