diff --git a/docs/content/docs/integrations/hono.mdx b/docs/content/docs/integrations/hono.mdx index ceeeb6d5f6..0837bac306 100644 --- a/docs/content/docs/integrations/hono.mdx +++ b/docs/content/docs/integrations/hono.mdx @@ -101,6 +101,9 @@ app.get("/session", async (c) => { if(!user) return c.body(null, 401); - return c.json(session, user); + return c.json({ + session, + user + }); }); ``` diff --git a/docs/content/docs/plugins/jwt.mdx b/docs/content/docs/plugins/jwt.mdx index 0b98b09325..251006aeb4 100644 --- a/docs/content/docs/plugins/jwt.mdx +++ b/docs/content/docs/plugins/jwt.mdx @@ -185,7 +185,9 @@ For security reasons, it's recommended to keep the private key encrypted. ```ts title="auth.ts" jwt({ - disablePrivateKeyEncryption: true + jwks: { + disablePrivateKeyEncryption: true + } }) ``` @@ -195,11 +197,13 @@ By default the entire user object is added to the JWT payload. You can modify th ```ts title="auth.ts" jwt({ - definePayload: (user) => { - return { - id: user.id, - email: user.email, - role: user.role + jwt: { + definePayload: (user) => { + return { + id: user.id, + email: user.email, + role: user.role + } } } }) @@ -210,8 +214,10 @@ If none is given, the BASE_URL is used as the issuer and the audience is set to ```ts title="auth.ts" jwt({ - issuer: "https://example.com", - audience: "https://example.com", - expiresIn: "1h" + jwt: { + issuer: "https://example.com", + audience: "https://example.com", + expirationTime: "1h" + } }) ``` diff --git a/docs/content/docs/reference/options.mdx b/docs/content/docs/reference/options.mdx index 2d0b6b5ca6..c00a73060f 100644 --- a/docs/content/docs/reference/options.mdx +++ b/docs/content/docs/reference/options.mdx @@ -235,7 +235,7 @@ const auth = betterAuth({ }} /> -### `trustedOrignins` +### `trustedOrigins` list of trusted origins. This is very important to prevent CSRF attacks and open redirects. diff --git a/examples/expo-example/expo-env.d.ts b/examples/expo-example/expo-env.d.ts new file mode 100644 index 0000000000..bf3c1693a0 --- /dev/null +++ b/examples/expo-example/expo-env.d.ts @@ -0,0 +1,3 @@ +/// + +// NOTE: This file should not be edited and should be in your git ignore diff --git a/packages/better-auth/src/client/query.ts b/packages/better-auth/src/client/query.ts index 235dcec777..7833723cc4 100644 --- a/packages/better-auth/src/client/query.ts +++ b/packages/better-auth/src/client/query.ts @@ -40,7 +40,6 @@ export const useAuthQuery = ( isPending: value.get().isPending, }) : options; - return $fetch(path, { ...opts, onSuccess: async (context) => { diff --git a/packages/better-auth/src/plugins/multi-session/client.ts b/packages/better-auth/src/plugins/multi-session/client.ts index 02799faddb..078590aebe 100644 --- a/packages/better-auth/src/plugins/multi-session/client.ts +++ b/packages/better-auth/src/plugins/multi-session/client.ts @@ -13,7 +13,7 @@ export const multiSessionClient = () => { matcher(path) { return path === "/multi-session/set-active"; }, - signal: "$sessionSignal" + signal: "$sessionSignal", }, ], } satisfies BetterAuthClientPlugin;