getting the following response //verification response { "message": "User (role: guests) missing scope (account)", "code": 401, "type": "general_unauthorized_scope", "version": "1.6.1" } when trying account.createverification commenting out createverification funtion,everything works fine
verify-email/page.tsx
I believe after creating the account you need to create a session, once that session is established you can send verification.
So right now, the issue is that there is no session set in the instance. So it is effectively a "guest"
how can i wait for the session
wym?
I guess what I would do would be do something like this
- Create Account
- Create Session based on credentials passed to create account
This will navigate you to a session success route. You can then call the create verification function. Or you can set a banned at the top of the page saying your email hasn't been verified, click here to verify.
thank you ,trying it out, u save my whole week :appwriteheart:
Oh, actually, I'm seeing here createEmailPasswordSession does not have a redirect so you could do
const email = "email@email.com"
const password = "Password1!"
const username = "Kenny"
await account.create(
ID.unique(),
email,
password,
username
);
await account.createEmailPasswordSession(
email,
password
);
await account.createVerification(
'https://locahost:3000/verify-email'
);
added a createEmailPasswordSession as u instructed boss, now its working!:appwriteheart: tysm
Sweet! Glad you got that figured out.
[SOLVED] createverification not working
Recommended threads
- Migration from Self-Hosted to Cloud seem...
Hello, I'm trying to migrate from my Self-Hosted Appwrite instance to Cloud, and can't figure out what's going wrong. - If I initiate the migration from Cloud...
- Password check in function
Hi, is there any way now for checking if the users password is correct in a function? I am creating a delete user function and before deleting I would like to c...
- Deployment fails after 15+ minutes: "Wai...
Hi, I'm Jayden. My email is jaydthom@haverford.org, and i'm having persistent deployment failures with my Next.js project. What happens: Push to GitHub trigg...