Possible unhandled promise rejection (id: 0): Error: AppwriteException: User (role: guests) missing
- 0
- React Native

Hello everyone, I need some help. I am building a mobile application with expo react native but I am getting this error: "Possible unhandled promise rejection (id: 0): Error: AppwriteException: User (role: guests) missing scope"
here is my code const client = new Client();
client .setEndpoint('') .setProject('');
const account = new Account(client);
export async function verifyNumber(userId, phoneNumber) { try {
const response = await account.createPhoneToken(
userId, // userId
phoneNumber // phone
);
console.log(response.userId);
AsyncStorage.setItem('userId', response.userId);
return response.userId;
} catch (error) {
throw new Error(error);
}
}
export async function checkOtp(userId, secret){ console.log(userId: ${userId}, secret: ${Number(secret)}); // Log the inputs try { const response = await account.updatePhoneSession( userId, // userId secret // secret ); console.log(response);
} catch (error) {
console.error(error.message);
throw new Error(error)
}
}
// Sign Out Appwrite export async function signOutAppWrite() { try { const session = await account.deleteSession("current");
return session;
} catch (error) {
throw new Error(error);
}
} I don't know how to solve this issue, please could i get some help
Recommended threads
- [AppwriteException: Network request fail...
When I tried to list the documents from one of the collections, it would show Error: Network request failed. But if I tried others, it would show all of the doc...
- How to detect user disconnection?
I'm creating a 1v1 challenge using realtime and i want to trigger a function when the user disconnect... how to make this using Appwrite Realtime? i searched i...
- User Authentication through REST API
Hey everyone, I’m looking for some guidance on the best way to authenticate frontend requests to my API gateway using Appwrite sessions. Right now, I'm trying ...
