
If not, how can I verify the emails of users which would be registering using email otp?

OTP
is the secret
, so it should be fine.

If that's the case, then why am I getting these error?

can you show some relevant code?

sdk versions would be good too in the details.

`export const register = async (email, password, name) => { try { const user = await account.create("unique()", email, password, name); if (user) { // Automatically log in after registration account.createEmailToken(ID.unique(), email, true).then( function (response) { console.log("Success sending otp"); // Success return response; }, function (error) { console.log("Failure sending otp", error); // Failure } ); // const session = await account.createSession(user.$id, secret); secret is the otp return { success: true, // data: session.data, emailVerification: user.emailVerification, userId: user.$id, // Return userId for OTP verification }; } return { success: false, error: "Registration failed" }; } catch (error) { console.error("Registration error:", error); return { success: false, error: error.message }; } };
export const verifyOTP = async (userId, secret) => { console.log("userId", userId, "\nOTP: ", secret); try { const response = await account.updateVerification(userId, secret); //I think it doesn't works with the otp response.then( function (response) { console.log("Verification was successful! \n", response); // Success }, function (error) { console.log("there was some error verifying the user \n", error); // Failure } ); return { success: true, data: response }; } catch (error) { console.error("OTP verification error:", error); return { success: false, error: error.message }; } };`

idk about sdk version but I am using appwrite 14.0.1

aah I see. My bad, you should be able to directly create a session. See - https://appwrite.io/docs/products/auth/email-otp

It means there is no way to verify a user through otp login?

looking at the source, once the session is created via magic-url
or otp
, the email should be marked as verified.

ooh, if that's the case. It would be nice!
Recommended threads
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
