Back

Need help deep linking for email verification.

  • 0
  • Self Hosted
Devils
16 Nov, 2024, 10:04

Like the title said, not really sure how you would do this properly. My current bit of code:

TypeScript
const handleResendEmail = async () => {
    setIsResending(true);
    try {
      const account = new Account(client);

      await account.createVerification('thravo://verify');

      setSnackbarMessage('Verification email resent. Please check your inbox.');
      setShowSnackbar(true);
    } catch (error) {
      console.error('Resend Verification Error:', error);
      setSnackbarMessage('Failed to resend verification email. Try again later.');
      setShowSnackbar(true);
    } finally {
      setIsResending(false);
    }
  };

I know this is likely not how this is done, since Appwrite apparently requires an actual url? Since I'm getting the error: Sign Up Error: [AppwriteException: Invalid url param: URL host must be one of: localhost, api.thravo.net, console.thravo.net]

This is on a self hosted instance, my application is using react native, expo, and expo go for testing purposes. Yes I have a custom SMTP server that I'm hosting on a different server, and yes it does work I've tested it.

TL;DR
Developers are having trouble properly deep linking for email verification in their React Native app using Appwrite. The error message suggests that an actual URL is required, not just the app's deep link. To solve this, developers should use a valid URL (e.g., hosted domain or IP address) in the `createVerification` method instead of just the app deep link.
Devils
16 Nov, 2024, 10:05

One second I forgot to include the actual SignUpScreen bits of code that calls for a verification code to be sent

Devils
16 Nov, 2024, 10:06

Pretty simple:

TypeScript
const appDeeplink = `thravo://verify`;
await account.createVerification(appDeeplink);
Devils
16 Nov, 2024, 10:07

Most of this code really isn't needed for this question tbh.

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