Perchun_Pak
Perchun_Pak
BABetter Auth
Created by Perchun_Pak on 4/6/2025 in #help
how to return more data from `/get-session`
hello, I would want to store user's balance inside session object, instead of fetching it manually I tried to create a plugin for better auth, but it doesn't work (it worked a few days before, I didn't change code nor updated dependencies...)
import type { BetterAuthClientPlugin } from "better-auth/client";
import type { BetterAuthPlugin } from "better-auth/plugins";

export const balancePlugin = () => {
return {
id: "balance",
schema: {
user: {
fields: {
balance: {
type: "number",
required: false,
sortable: false,
unique: false,
returned: true,
},
},
},
},
} satisfies BetterAuthPlugin;
};

export const balanceClientPlugin = () => {
return {
id: "balance",
$InferServerPlugin: {} as ReturnType<typeof balancePlugin>,
} satisfies BetterAuthClientPlugin;
};
import type { BetterAuthClientPlugin } from "better-auth/client";
import type { BetterAuthPlugin } from "better-auth/plugins";

export const balancePlugin = () => {
return {
id: "balance",
schema: {
user: {
fields: {
balance: {
type: "number",
required: false,
sortable: false,
unique: false,
returned: true,
},
},
},
},
} satisfies BetterAuthPlugin;
};

export const balanceClientPlugin = () => {
return {
id: "balance",
$InferServerPlugin: {} as ReturnType<typeof balancePlugin>,
} satisfies BetterAuthClientPlugin;
};
so my question is, how to store more data in the session object?
4 replies
BABetter Auth
Created by Perchun_Pak on 2/12/2025 in #help
vite tries to cache my authorization calls
hello, when i log in my account, everything works correctly, but as soon as I try to do another auth request (e.g. sign out), backend just doesn't answer (including my own, not only auth) if I run vite with --debug, it outputs vite:cache [memory] virtual:__sveltekit/paths on every frozen request have someone encountered a similar issue?
3 replies