Skip to content

Sign in with Apple doesn't redirect to iOS app #954

@connorlindsey

Description

@connorlindsey

Bug report

Describe the bug

I'm building a Capacitor app with Supabase and am including Google and Apple as auth providers. I also have a web application built with Next.js using the same Supabase instance.

When signing in to the mobile app with Google on iOS, the user successfully gets redirected back to the mobile app and logged in. When signing in with Apple, it redirects to the web app with the credentials in the URL instead of deep linking to the app (even though I'm using the same redirect to url for both providers).

I need to read up more on GoTrue, but maybe it has something to do with including the redirectTo in the callback url? The call to /authorize will include redirectTo but the callback is set statically.

To Reproduce

  1. Configure Apple as an auth provider in Supabase (I know the Apple config works because users can sign into the web app successfully)
  2. Configure deep links with Capacitor
  3. In the app, the user signs in with Supabase await sb.auth.signIn({ provider: <apple or google> }, { redirectTo: "mysite.com/mobile" })
  4. The web app ignores the session in the url and handles it manually if it's not going to the "mobile" url so it's not consuming the mobile credentials (supabaseClient = createClient(url, key, { detectSessionInUrl: false }))
  5. Deep links are configured successfully and included in the Supabase auth configuration for additional redirect urls. If I copy the url that appears after signing in with Apple to another app like Notes and click it, it opens the mobile app and logs the user in which is the expected behavior.

Unfortunately I'm not sure of a great way to make a reproducible example given the amount of config that goes into setting up deep links + sign in with Apple.

Expected behavior

  1. User clicks signs in with Apple
  2. User authenticates with Apple
  3. Redirect back to the mobile app
  4. User is signed in

System information

  • OS: iOS
  • Version of supabase-js: 1.35.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    authbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions