supabase-swift icon indicating copy to clipboard operation
supabase-swift copied to clipboard

`Auth.KeychainError(code=itemNotFound)` on MacOS with SDK v2.16

Open rebryk opened this issue 1 year ago • 14 comments

Bug report

  • [+] I confirm this is a bug with Supabase, not with my own application.
  • [+] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When i switched from supabase v2.0 to v2.16 try await supabaseClient.auth.session throws Auth.KeychainError(code=itemNotFound) on MacOS.

To Reproduce

  1. Create a sign URL
try supabaseClient.auth.getOAuthSignInURL(
      provider: Provider.google,
      redirectTo: `app-schema://auth`
)
  1. Open url
NSWorkspace.shared.open(url)
  1. Handle deeplink after Google authorization
func application(_ application: NSApplication, open urls: [URL]) {
    if let url = urls.first, url.host == "auth" {
        Task {
            try await supabaseClient.auth.session(from: url)
        }
    }
}
  1. Step 3 returns a valid session; however, try await supabaseClient.auth.session will throw an Auth.KeychainError(code=itemNotFound) error.

Expected behavior

I expect try await supabaseClient.auth.session to restore the session from the keychain as it did before in previous SDK versions.

System information

  • OS: macOS
  • Browser (if applies) Arc Browser
  • Version of supabase: v2.16

rebryk avatar Aug 28 '24 06:08 rebryk