
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
- google auth help
i am dealing with old sing in google everytime I sign in, to deal with it i added prompts consent, which i dont know for what reason is not working, i am usin...
- C# Server error
Hi! Here is a part of the code without any important data. The error is "Server error" without more return. `` Client client = new Client() .SetEnd...
- PHP Error
Hi guys, I tried to use Appwrite for the first time in PHP and got a certificate error. I did not find any solution. I tried to create users. Here's the message...
