FalconiZzare
Explore posts from serversBABetter Auth
•Created by phantom3313 on 4/22/2025 in #help
Is it okay for getsession req to be made for every protected route or I should cache it?
You can use useSession in the root layout of protected route. It will be fetched only once then,,, considering u use NextJs
8 replies
BABetter Auth
•Created by FalconiZzare on 4/24/2025 in #help
Redirection after sign in
@Ping @bekacru sorry for the mention 😦
3 replies
BABetter Auth
•Created by phantom3313 on 4/22/2025 in #help
Is it okay for getsession req to be made for every protected route or I should cache it?
You can do so using Redux or Zustand, or by using stored cookie, however the session won't be fresh then, so user maybe able to see the UI of your protected route even if the session has ended in server/db. make sure to check session on server side for request.
Also look into better-auth getSession and useSession functions, both are different and one probably uses built in cache AFAIK
8 replies
BABetter Auth
•Created by phantom3313 on 4/22/2025 in #help
Is it okay for getsession req to be made for every protected route or I should cache it?
It should be that way. However you can use redis or any other similar approach to mitigate load on your auth server.
8 replies
BABetter Auth
•Created by mfragale on 3/18/2025 in #help
Session still active after calling authClient.revokeSession
It also might be related to the device/browser session remenent
7 replies
BABetter Auth
•Created by mfragale on 3/18/2025 in #help
Session still active after calling authClient.revokeSession
I see. Though I need shorter session period for App requirements. Will what happens. Working fine so far
7 replies
BABetter Auth
•Created by mfragale on 3/18/2025 in #help
Session still active after calling authClient.revokeSession
Did you remove the cache from config or refreshed teh cache to solve the issue?
7 replies
BABetter Auth
•Created by FalconiZzare on 3/11/2025 in #help
User agent update
Oh I see. Anyway built in way to update the header during the process? Or should I just update the record manually by calling my own API right after successful login?
7 replies
BABetter Auth
•Created by FalconiZzare on 3/11/2025 in #help
User agent update
any insight on where to look for potential issue would be very helpful.
7 replies
BABetter Auth
•Created by FalconiZzare on 3/11/2025 in #help
User agent update
@bekacru sorry for the ping, any idea?
7 replies
BABetter Auth
•Created by FalconiZzare on 3/10/2025 in #help
Google Social Sign with idToken
@bekacru sorry for the ping, any idea?
4 replies
BABetter Auth
•Created by Allan on 3/10/2025 in #help
How to store custom data in session?
You can look into the customSession funtion.
https://www.better-auth.com/docs/concepts/session-management#customizing-session-response
This will not necessarily need storing the newField to the database. However customSession function doesn't support caching.
9 replies