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
- Invalid origin error in authentication
I have setup the package name same as the package name in app.json but it is constantly saying `AppwriteException: Invalid Origin. Register your new client as ...
- Functions Problem
Whenever I run my AI Generate through Appwrite Functions, I am getting this Call Stack AIService.generateServer (src\services\ai\gemini.ts) next (<native>) ...
- Auth working for emulator but not for ph...
hey guys i'm using appwrite for expo react native it is working perfectly for emulator but does not working for physical devices can u explain any one and it is...