FalconiZzare
FalconiZzare
Explore posts from servers
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 Jose on 3/27/2025 in #help
Express error
share your cors setup code
2 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
No description
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
No description
4 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.
import { customSession } from "better-auth/plugins";

export const auth = betterAuth({
plugins: [
customSession(async ({ user, session }) => {
const roles = findUserRoles(session.session.userId);
return {
roles,
user: {
...user,
newField: "newField",
},
session
};
}),
],
});
import { customSession } from "better-auth/plugins";

export const auth = betterAuth({
plugins: [
customSession(async ({ user, session }) => {
const roles = findUserRoles(session.session.userId);
return {
roles,
user: {
...user,
newField: "newField",
},
session
};
}),
],
});
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