Skip to content
Back

OAuth Login Doesn’t Work on iPhone (Safari) with Appwrite Default Domain

  • 0
  • Auth
  • Apple
Osmanlı
28 May, 2025, 21:50

hey there!

i am trying to use a custom domain for auth. as i am currently using https://nyc.cloud.appwrite.io/v1 but auth doesn’t work on iphone or safari because i assume it's because i am not using the related domain. i am a little bit confused about the process to activate my custom domain for auth.

i already added a custom domain on the appwrite console but not quite familiar with what i am supposed to do next.

appreciate any help.

` login: async ({ providerName, email, password }) => { if (providerName === "google" || providerName === "apple") { try { const redirectURL = window.location.origin;

TypeScript
    account.createOAuth2Session(providerName, redirectURL, redirectURL);
    return {
      success: true,
    };
  } catch (error: any) {
    return {
      success: false,
      error: {
        name: error.code,
        message: error.message,
      },
    };
  }
}


try {
  await account.deleteSession('current');
} catch (_) {}

try {
  await account.createEmailPasswordSession(email, password);
  return {
    success: true,
    redirectTo: "/",
  };
} catch (error) {
  const { type, message, code } = error as AppwriteException;
  return {
    success: false,
    error: {
      message,
      name: `${code} - ${type}`,
    },
  };
}

},`

TL;DR
Developers facing issues with OAuth login on iPhone Safari due to using a custom domain for authentication. Confusion on custom domain activation process despite adding it in the Appwrite console. The code snippet provided seems linked to the issue of not being able to authenticate with the custom domain. Work on mapping the custom domain correctly in the authentication process to resolve the login problem on iPhone Safari.
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