Old fellaOriginal post
Rank 1: Thread
when I do this :
Plain text
import { account } from '$lib/appwrite';let loggedInUser: any;async function init() { try { console.log('Starting App'); loggedInUser = await account.get(); // Check if the user is already logged in console.log(loggedInUser.name); } catch (error) { loggedInUser = null; console.error('Error fetching logged-in user:', error); }}init();```I got this ressult :```code: 401, type: 'general_unauthorized_scope', response: { message: 'User (role: guests) missing scope (account)', code: 401, type: 'general_unauthorized_scope', version: '1.6.1' }}```Summary
Developers are encountering a 401 error (general_unauthorized_scope) when trying to fetch teams. The issue seems to be with importing the user from local storage to check authority. The code snippets provided attempt to rectify the problem, but the unauthorized scope error persists. This might be due to missing user scopes (such as 'account'). Further troubleshooting is necessary.