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
- User ID case sensitivity
I see that through REST (and SDK as well), getting a user is not case sensitive. And even though documentation does not clearly state that it is, the wording "V...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...