Hey,
I'm trying to verify the user once they create their account. I'm running an expo project.
I thought that user authentication would be easy but it's turning out to be a headache and I'd really appreciate some guidance.
My question is why, based on the code below, do I get the error
LOG [AppwriteException: User (role: guests) missing scope (account)]
code:
const client = new Client();
client
.setEndpoint(config.endpoint) // Appwrite Endpoint
.setProject(config.projectId) // project ID
.setPlatform(config.platform) // application ID or bundle ID.
;
const account = new Account(client);
// signup
export const createUser = async (email, password) => {
try {
const newAccount = await account.create(ID.unique(), email, password);
if (!newAccount) throw Error('Error creating user');
// login the user
Login(email, password);
// Send verification email
const verify = await account.createVerification('BookQuest://(auth)/verify');
console.log(verify)
return newAccount;
} catch (error) {
console.log(error);
throw new Error(error);
}
}
// signin
export const Login = async (email, password) => {
try {
const session = await account.createEmailPasswordSession(email, password);
return session;
} catch (error) {
throw new Error(error)
}
}
I also need help understanding how the whole verification process should work with an expo app.
Thanks in advance
Recommended threads
- Current User is Not authorized
recreating same Thread
- 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...
- Error: User (role: guests) missing scope...
I want to send a verification code to the user and the given phone number and check it and create a session right after the user entered the secret. For me that...