Impossible to get USER after createEmailPasswordsessions. (ERROR 401 on account.get) Flutter for web
- 0
- Auth
- Flutter
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { await account.createEmailPasswordSession( email: email, password: password, ); print("Account est créé avec emails");
late dynamic user;
try {
user = await account.get();
} catch (e) {
debugPrint("Impossible de récupérer l'utilisateur : $e");
}
print("user : $user)");
if (user.labels.contains("admin")) {
await fetchAdminData();
return "admin";
} else {
await fetchCurrentOffreurData(email);
return "offreur";
}
} catch (e) {
debugPrint("Erreur login: $e");
return null;
}
}
I always get : Impossible de récupérer l'utilisateur : AppwriteException: general_unauthorized_scope, User (role: guests) missing scopes (["account"]) (401)
The session is created. But for some reason, user is considered GUEST even though session was created with email & password. So authentified.
Impossible to get USER after createEmailPasswordsessions. (ERROR 401 on account.get) Flutter/DART
Impossible to get USER after createEmailPasswordsessions. (ERROR 401 on account.get) Flutter for web
Recommended threads
- Courtesy limit reset for non-profit migr...
Hi Team! I'm the architect for a 501(c)(3) non-profit project (Aaria's Blue Elephant) and we just hit our Free plan Database Read limit (currently at 164%). Th...
- RBAC design question
Hi, I am trying to create RBAC so we will have multiple orgs in the app each org will have 3 roles (admin, member and read only) what is the best way to go ab...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.