FalconiZzare
FalconiZzare
Explore posts from servers
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