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
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...
- 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...