Back

How to verify email

  • 0
  • Flutter
  • Auth
  • Cloud
liukai
23 Jun, 2024, 08:39

I am using flutter to develop. After calling the createVerification method, I received an email. Then I clicked on the email, but the user in the cloud.appwrite.io backend is still not verified. I don't know what to set。 final models.User user = await AppwriteService.instance.account.create( userId: ID.unique(), email: email, password: password, //name: name, ); final session = await AppwriteService.instance.account .createEmailPasswordSession(email: email, password: password); // 发送验证邮件 await AppwriteService.instance.account.createVerification( url: 'https://cloud.appwrite.io/', ); is that right?

TL;DR
To verify email for Flutter development using Appwrite: - Set the URL to your app in the verification page - Trigger `account.updateVerification(userId, secret)` on the verification page - After calling `createVerification` method, click on the email link for verification Your code seems correct, but ensure you are setting the `userId` and `secret` correctly in `account.updateVerification(userId, secret)`.
D5
23 Jun, 2024, 08:45

You need to set the URL to a page of your app (deep link) or to an external website (for example: https://authui.site) in order to complete the verification.

In the verification page, you will need to trigger account.updateVerification(userId, secret); and specify there the user account and the secret that was in the URL

D5
23 Jun, 2024, 08:45
liukai
23 Jun, 2024, 08:46

That means I need to write my own page that validates the user

D5
23 Jun, 2024, 08:47

Yes

D5
23 Jun, 2024, 08:47

Or use Authui, that is the link I sent, but the app will not be opened as it will be handled there

liukai
23 Jun, 2024, 08:56

OK, thanks for your reply:appwritepeepo:

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more