Closed HuakunShen closed 1 month ago
I tried to use supabase.auth.exchangeCodeForSession(route.query.code)
to manually authenticate with code, but got error: invalid request: both auth code and code verifier should be non-empty
code verifier somehow doesn't exist.
Problem solved. The ?code=xxxx
still couldn't be handled automatically, but supabase.auth.exchangeCodeForSession(route.query.code)
works now.
I found that I have to initiate signin from the desktop app using supabase.auth.signInWithOAuth()
.
What I did previously was initiating signin from a regular web app and redirect to desktop app using deep link, but without supabase.auth.signInWithOAuth()
from desktop app, the verify request will be missing code verifier
I am trying to use this module in a desktop app with Tauri, through deep link. I experimented with the same route with http and a custom deep link scheme, the http one successfully authenticated, but failed with deep link.
Example
http://localhost:3000/callback?code=xxxxxxx
myapp://callback?code=xxxxxxx