
I am trying to get current User, but get this error message when I do. I get back user prefs, but error comes from trying account.get() So I am getting User. I am not sure what variable is not set. I looked into User object, It can be status, emailVerification, phoneVerification, mfa, totp. There is no other bool it is expecting.
TypeScript
Client client = Client();
client
.setEndpoint(DBConstants.localhostAccessPoint)
.setProject(DBConstants.localhostProjectID)
.setSelfSigned(status: true);
Account account = Account(client);
Preferences prefs = await account.getPrefs();
print('prefs: ${prefs.data}');
User user = await account.get();
TL;DR
Issue: Error message "Expected a value of type 'bool', but got one of type 'Null'" when trying to get the current User.
Solution: The error might be caused by a missing or null value in the User object attributes. Check for any null values in the User object's status, emailVerification, phoneVerification, mfa, or totp attributes. Adjust the code to handle potential null values in these attributes before calling the account.get() method.Recommended threads
- Selfhosting problem
I'm migrating from cloud to self-hosted. I tried using 'Export to self-hosted instance' and use my free Ngrok domain as Endpoint self-hosted instance, but I got...
- Need help setting up this error is showi...
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cl...
- Direct Upgrade from Appwrite v1.5.11 to ...
I'm on Appwrite v1.5.11. Can I upgrade directly to v1.6.2?
