Rank 2: Process
how to access the value of account status
Votes
0
Replies
9
Participants
Unknown
Messages
10
Rank 4: Virtual Machine
Could you explain a bit more what your trying to do ?
is it like access the status from the server SDK ?
access the reason why it's blocked ?
or maybe somthing else ?
Rank 2: Process
i just need to access that status string from server: blocked or verified or unverified that it
Can you try doing something like this? -
const user = await users.get(userId);
console.log(user.status);
console.log(user.emailVerification);
let accountStatus = "";
if (!user.status) {
accountStatus = "blocked";
} else if (user.emailVerification) {
accountStatus = "verified";
} else {
accountStatus = "unverified";
}
console.log(accountStatus);
You can see various users properties available here - https://appwrite.io/docs/references/cloud/models/user
Rank 2: Process
Thank you
Mention not 👍
Rank 2: Process
How is there is command for that
Rank 2: Process
In my opinion, there isn't any built in property/command which directly returns status like "blocked", "verified", etc. It's neither mentioned in the docs, so you need to derive it explicitly