I've been trying to make login and signup page for my project. I am new to appwrite as well, Whenever, I try to login with the below implementation. It always states general_unauthorized_scope, User (role: guests) missing scope (account) (401). This seems like a permission issue. But I can't find anything related to it in the appwrite console except the API key. When I use the API key using .setJWT(), It says some parts of API key is missing. What is the actual problem here? Am I wrong with this implementation? How do I fix this issue in the first place?
This is my appwrite_controllers.dart file: ``` class AppwriteService { final Client client = Client(); late final Account account; late final Databases databases; late final Storage storage;
AppwriteService() { client .setEndpoint(dotenv.env['API_ENDPOINT']!) .setProject(dotenv.env['PROJECT_NAME']!);
account = Account(client);
databases = Databases(client);
storage = Storage(client);
}
Future<Session?> loginEmailPassword({ required String email, required String password, }) async { try { await account.deleteSessions(); final session = await account.createEmailPasswordSession( email: email, password: password, );
print('User logged in successfully: ${session.$id}');
return session;
} on AppwriteException catch (e) {
print('Error logging in: ${e}');
rethrow;
}
} }
This is my login_screen.dart file (as attachment).
Recommended threads
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...
- My account got banned without obvious re...
Hello, I’m a normal user of Appwrite. Today I found my account was banned suddenly, and I can’t log in normally. I have only been doing normal development and...
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...