
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
- when is password optional for updatePass...
In the document it says that the old password is option when updatingPassword but when i implemented it requires me to give it my old password. So when is the o...
- Unable to resolve "node-fetch-native-wit...
I using react native and want to use node.js to create a custom token but i get this error. i have done npm i node-fetch-native-with-agent to see if that solves...
- why do I get this error sometimes?
hello everyone, I am integrating authorization via Yandex into my application and I often get Error Error 400 There was an error processing your request. Please...
