Omicrxn
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
but some like google don't support it
14 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
if your auth supports deep linking you can also do it directly
14 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
yeah so there are two approaches here, one is spawning a server when you start the oauth flow that will be the redirect route but don't recommend it as it's a plugin of tauri and stuff so don't know the equivalent in capacitor. So what you can do is leave the default redirect url and add a middleware that calls a deeplink which comes back to your app
14 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
also what framework are you using?
14 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
when you say auth webview, is the same webview from capacitor or an external browser?
14 replies
BABetter Auth
•Created by Sina on 4/23/2025 in #help
Social login for native apps
hey i struggled with that too, using Tauri. However the setup you are describing sounds good, what is the issue?
14 replies
BABetter Auth
•Created by gursh on 3/8/2025 in #help
Google oauth redirecting to /api/auth
Like supabase
supabase.auth.exchangeCodeForSession('oauth code')
13 replies
BABetter Auth
•Created by gursh on 3/8/2025 in #help
Google oauth redirecting to /api/auth
hey @KiNFiSH do you know if there is a way to exchange the code manually?
13 replies
BABetter Auth
•Created by vijayatk3 on 4/17/2025 in #help
How to set Bearer token in Next.js
actually i was getting the same issue on sveltekit, and in the docs it says to put auth-client under lib/ so maybe it should be updated on the docs:
https://www.better-auth.com/docs/integrations/svelte-kit#create-a-client
11 replies
BABetter Auth
•Created by Omicrxn on 4/17/2025 in #help
Unclear on how to handle session and cookies in sveltekit
damm hate it when these silly mistakes take too long hahahah the life of a programmer, however it is not my scenario, I only have app/ route protected, api and others should be fine, thanks for the tip though, appreciate it!
9 replies
BABetter Auth
•Created by Omicrxn on 4/17/2025 in #help
Unclear on how to handle session and cookies in sveltekit
i've been trying multiple methods, even using the client Auth but no luck the session is always null, in server and in client, using getSession, useSession it doesn't matter, the database does have an access token so i guess the auth is completing successfully. Any insights?
9 replies
BABetter Auth
•Created by Omicrxn on 4/17/2025 in #help
Unclear on how to handle session and cookies in sveltekit
Thank you for the help in advanced!
9 replies
BABetter Auth
•Created by Omicrxn on 4/17/2025 in #help
Unclear on how to handle session and cookies in sveltekit
i think this issue proposes something similar to what supabase does: https://github.com/better-auth/better-auth/issues/2020
9 replies
BABetter Auth
•Created by Omicrxn on 4/17/2025 in #help
Unclear on how to handle session and cookies in sveltekit
After doing so my session is still null on all server side and also in the
+hooks.svelte.ts
where i do an Auth Guard which doesn't get triggered as the session is null. I've seen similar issues and the answer is saying to set the cookies manually as server getSession()
doesn't do that but despite knowing how to do it with event.cookies.set
it's unclear how to get the auth cookie from better auth. Also i think a great idea would be that better auth handles this internally, for instance supabase does this like this:
overall my request is that the sveltekit docs get updated to a real world scenario and also something that actually works similar to supabase docs where you can see how to handle typical files such as +hooks.server.ts
+layout.ts
etc
https://supabase.com/docs/guides/auth/server-side/sveltekit and also to know how cookies must be handled in sveltekit server9 replies