Skip to content
Back

React native app login via Safari

  • 1
  • React Native
  • Web
  • Auth
Slawke
25 Apr, 2025, 09:53

Hi! I deployed for debug my React Native app in web, chrome everythink works well but in safari on mac and ios I cant login. I found this one error in safari console: { "message": "User (role: guests) missing scope (account)", "code": 401, "type": "general_unauthorized_scope", "version": "1.6.2" }

It's too general to help me, so i dont know what to do :/

TL;DR
Developers faced issues while trying to implement app login via a custom domain on Appwrite. They encountered a "Preflight response is not successful. Status code: 421" error when trying to access the domain. The solution involved checking the custom domain certificates and ensuring proper settings on Appwrite. Additional issues were seen on Safari, causing login problems. The suggested fallback mechanism was localStorage, but further troubleshooting required inspecting network traffic and response headers. Custom domain usage was recommended to address browser-specific problems. In Safari, the error message indicated a scope permission problem, pointing to the need for further investigation and adjustments.
Venom
25 Apr, 2025, 10:52

You need to use custom domain. See this docs: https://appwrite.io/docs/advanced/platform/custom-domains

Slawke
25 Apr, 2025, 11:12

Hmmm but why in chrome Works amd in Safari not with current settings?

Slawke
25 Apr, 2025, 11:13

Right, found reason under doc from your link: some browsers will treat our secure cookies as 3rd-party cookies and block them

Slawke
25 Apr, 2025, 11:13

I’ll check and get back with results

Steven
25 Apr, 2025, 15:32

Weird...we should have a fallback mechanism in case cookies aren't available 🧐

Steven
25 Apr, 2025, 15:33

How are you creating the session? Can you use the dev tools to inspect the network traffic and get the response headers?

Steven
25 Apr, 2025, 15:34

Hmm actually, it's probably because window is undefined

Steven
25 Apr, 2025, 15:35

err wait. if it's in a browser, window should work 🧐

Venom
26 Apr, 2025, 02:05

The fallback mechanism is localStorage, right?

Venom
26 Apr, 2025, 02:06

When I tested with Flutter Web, it worked in Chrome but not Safari

Venom
26 Apr, 2025, 02:07

So eventually I had to buy custom domain 🥹

Slawke
26 Apr, 2025, 13:57

I followed this custom domains doc from link above, but im issuing another error. I registered DNS CNAME appwrite.slajob.dev pointing to fra.cloud.appwrite.io with dns only (without proxy). In appwrite custom domain appwrite.slajob.dev everything set correctly: Verification Status:verified, Certificate Status: generated. When i try to enter this appwrite.slajob.dev i see

In my react native app in safari still getting error: Preflight response is not successful. Status code: 421 Fetch API cannot load https://appwrite.slajob.dev/v1/account/sessions/email due to access control checks. Failed to load resource: Preflight response is not successful. Status code: 421

There is something wrong with appwrite custom domain certificate?

Venom
26 Apr, 2025, 16:08

Now, that is another problem of Appwrite side - https://discord.com/channels/564160730845151244/1364154095006519318

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