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
- Deep Linking & Password reset
I am using react native with expo. I want to implement deep link with the url recived via email. So when clicked the link it opens my app. I havent ever used de...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...
- [SOLVED] React Native Appwrite SDK not w...
So I'm trying to generate a unique ID using the ID.unique() and its generating properly, but its saying its longer than 36 characters but it isnt.. ```typescri...