Back
getSession and listSessions return User (role: guests) missing scope (account)
- 0
- Self Hosted
- Auth
![](https://cdn.discordapp.com/embed/avatars/1.png)
TypeScript
try {
const sessionClient = new sdk.Client()
.setEndpoint(process.env.AWENDPOINT)
.setProject(process.env.AWPROJECTID);
const account = new sdk.Account(sessionClient);
const session = await account.createEmailPasswordSession(email, password);
console.log("Session created:", session.$id);
sessionClient.setSession(session);
// TEMP
const tempClient = new sdk.Client()
.setEndpoint(process.env.AWENDPOINT)
.setProject(process.env.AWPROJECTID)
.setSession(session);
const account1 = new sdk.Account(tempClient);
//console.log(account1);
//console.log(account1.client.headers["x-appwrite-session"]);
//const sessionsList = await account1.listSessions();
const result = await account.getSession(session.$id);
console.log(result);
console.log(sessionsList);
// END TEMP
const users = new sdk.Users(adminClient);
const user = await users.get(session.userId);
const username = user.email;
Everything else seem to work. I see the session Id and other info. Why accessing sessions is giving an error? Another thing to note: In the console, sessions list the browser/device, location and IP but field "Session" is always empty...
TL;DR
Developers are having issues accessing sessions using getSession and listSessions methods. The error is related to missing scope (account). The console displays the session Id and other information properly but 'Session' field remains empty in sessions list. Recommended threads
- Hello everyone, I am getting Type: Utopi...
Hi, we are running appwrite 1.3.7 but sometimes we are getting error like Type: Utopia\Exception [Error] Message: Not Found [Error] File: /usr/src/code/vendor/u...
- Hello everyone I'm getting this error, a...
Hello everyone I'm getting this error, any documentation out for it?
- OAuth2 with SwiftUI fails to save cookie
Hi everyone, I'm trying to integrate OAuth2 with the SDK for Apple. Everything works as expected, but somehow the session is not passed on to the app. When ex...
![](/images/bgs/pre-footer.png)