Sina
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
but what do you do with the cookie I guess you have to set it in search then set it via the client, or make a xhr call from the client with some id that sets the cookie
13 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
do you have any code to share? Its easier to follow along then, but from what I'm reading I imagine its something along these lines
13 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
but from what I briefley read about tauri it looks similar to capacitor how did you solve social? given the redirect url from better auth what do you do after?
13 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
auth webview I mean another browser spawned by the capacitor app by running
await Browser.open({ redirectUrl });
framework if you mean our backend its elysia? Our frontend is react and capacitor13 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
One idea is to do the oidc flow for the provider in the frontend and then use the id token to do the signin against better auth would result in a lot of code, but since I dont have a browser where I can intercept the callback as in the above code I think my options are limited -- not sure if there is a easy way to pass assets such as a cookie in search params or whatever on callbackURL pointing to the app
13 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
The problem is that the cookie is set in the webview (used for auth). So subsequent calls to get session does not have cookies set since they where set in the auth webview, confusingly capacitor is essentially a webview running a react app not to be confused with the auth webview.
Read a bit in the source for the expo plugin and found this block where they intercept the webview once it gets to the callback, and its quite neat but unfortunately the webview capcitor has does not support this feature
13 replies