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
- Auth broken after update from 1.8.0 to 1...
So ive been having issues creating, deleting or updating users on my appwrite instance after i updated from 1.8.0 to version 1.9.0. When trying to create a user...
- Websocket error Realtime
Hi peeps, I am trying to create realtime updates and I am having websocket error Code is below this msg
- Magic Link woes/noob
Magic Link is working; it sends the link to my email. But the link itself always leads to "Page Not Found. The page you're looking for doesn't exist". Clicking ...