Skip to content

v1.3.8#4410

Merged
Bekacru merged 147 commits into
mainfrom
v1.3.8-staging
Sep 4, 2025
Merged

v1.3.8#4410
Bekacru merged 147 commits into
mainfrom
v1.3.8-staging

Conversation

@himself65
Copy link
Copy Markdown
Contributor

@himself65 himself65 commented Sep 3, 2025

v1.3.8

Sep 3, 2025

🚀 Features

  • OAuth Device Authorization Flow - Added full support for OAuth 2.0 Device Authorization (RFC 8628) with server and client plugins, perfect
    for TV apps and CLI tools
  • 8 New OAuth Providers - PayPal, Atlassian, Figma, Salesforce, Cognito, LINE, Kakao, and Naver integration
  • Improved Documentation Search - Implemented Orama-powered search with a new UI dialog for faster navigation
  • Enhanced Testing Infrastructure - Added E2E Playwright tests and smoke tests for Bun, Deno, and Cloudflare Workers runtime compatibility

🐞 Bug Fixes

  • Fixed profile mapping issues across various OAuth providers
  • Resolved schema generation edge cases
  • Improved Microsoft Entra ID type definitions
  • Enhanced sign-up component behavior

📚 Documentation

  • Added comprehensive provider integration guidelines
  • Expanded Organization feature documentation
  • Improved getting started guides

🔧 Developer Experience

  • Tightened Biome linting rules for better code quality
  • Improved Turbo caching for faster builds
  • Updated CI Node versions for modern compatibility

Bekacru and others added 30 commits August 21, 2025 11:38
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
Co-authored-by: Kinfe123 <kinfishtech@gmail.com>
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
@himself65 himself65 requested a review from Bekacru as a code owner September 3, 2025 22:22
@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
better-auth-demo Ready Ready Preview Comment Sep 4, 2025 0:46am
better-auth-docs Ready Ready Preview Comment Sep 4, 2025 0:46am

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Sep 3, 2025

Open in StackBlitz

better-auth

npm i https://pkg.pr.new/better-auth/better-auth@4410

@better-auth/cli

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/cli@4410

@better-auth/expo

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/expo@4410

@better-auth/sso

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/sso@4410

@better-auth/stripe

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/stripe@4410

commit: 1cabe4a

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

40 issues found across 275 files

Note: This PR contains a large number of files. cubic only reviews up to 150 files per PR, so some files may not have been reviewed.

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

"mongodb": "^6.18.0",
"mysql2": "^3.14.3",
"next": "^15.5.0",
"ms": "4.0.0-nightly.202508271359",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ms is a runtime dependency (imported and used in runtime code) but is declared under devDependencies; consumers will hit a missing module at runtime. Move ms to dependencies.

Prompt for AI agents
Address the following comment on packages/better-auth/package.json at line 742:

<comment>ms is a runtime dependency (imported and used in runtime code) but is declared under devDependencies; consumers will hit a missing module at runtime. Move ms to dependencies.</comment>

<file context>
@@ -717,15 +732,16 @@
     &quot;mongodb&quot;: &quot;^6.18.0&quot;,
-    &quot;mysql2&quot;: &quot;^3.14.3&quot;,
-    &quot;next&quot;: &quot;^15.5.0&quot;,
+    &quot;ms&quot;: &quot;4.0.0-nightly.202508271359&quot;,
+    &quot;mysql2&quot;: &quot;^3.14.4&quot;,
+    &quot;next&quot;: &quot;^15.5.2&quot;,
</file context>

@@ -0,0 +1,30 @@
import { betterAuth } from "better-auth";
import { DatabaseSync } from "node:sqlite";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing from "node:sqlite" will fail to resolve when run under Deno because there is no core module or alias for this specifier; the server will crash at startup.

Prompt for AI agents
Address the following comment on e2e/smoke/test/fixtures/deno-simple.ts at line 2:

<comment>Importing from &quot;node:sqlite&quot; will fail to resolve when run under Deno because there is no core module or alias for this specifier; the server will crash at startup.</comment>

<file context>
@@ -0,0 +1,30 @@
+import { betterAuth } from &quot;better-auth&quot;;
+import { DatabaseSync } from &quot;node:sqlite&quot;;
+import { getMigrations } from &quot;better-auth/db&quot;;
+
</file context>

}
}
if (authentication === "basic") {
const encodedCredentials = base64Url.encode(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic Authorization must use standard Base64, not base64url; this will cause authentication failures with most OAuth2 providers when authentication === "basic".

Prompt for AI agents
Address the following comment on packages/better-auth/src/oauth2/client-credentials-token.ts at line 35:

<comment>Basic Authorization must use standard Base64, not base64url; this will cause authentication failures with most OAuth2 providers when authentication === &quot;basic&quot;.</comment>

<file context>
@@ -0,0 +1,97 @@
+		}
+	}
+	if (authentication === &quot;basic&quot;) {
+		const encodedCredentials = base64Url.encode(
+			`${options.clientId}:${options.clientSecret}`,
+		);
</file context>

],
})
.catch((error) => {
ctx.logger.error(`Failed to delete expired API keys:`, error);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errors are logged but not rethrown in the catch block, causing the function to resolve successfully even if deleteMany fails; this hides failures and changes previous error propagation behavior.

(Based on previous feedback about ensuring all async operations have proper error handling.)

Prompt for AI agents
Address the following comment on packages/better-auth/src/plugins/api-key/routes/index.ts at line 69:

<comment>Errors are logged but not rethrown in the catch block, causing the function to resolve successfully even if deleteMany fails; this hides failures and changes previous error propagation behavior.

(Based on previous feedback about ensuring all async operations have proper error handling.)</comment>

<file context>
@@ -64,10 +64,10 @@ export function deleteAllExpiredApiKeys(
 			],
+		})
+		.catch((error) =&gt; {
+			ctx.logger.error(`Failed to delete expired API keys:`, error);
 		});
-	} catch (error) {
</file context>

async sendInvitationEmail(data) {
// ... your invitation email logic
},
async onInvitationAccepted(data) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documents an unsupported config option onInvitationAccepted; use organizationHooks.afterAcceptInvitation instead.

Prompt for AI agents
Address the following comment on docs/content/docs/plugins/organization.mdx at line 948:

<comment>Documents an unsupported config option onInvitationAccepted; use organizationHooks.afterAcceptInvitation instead.</comment>

<file context>
@@ -589,21 +916,52 @@ type acceptInvitation = {
+      async sendInvitationEmail(data) {
+        // ... your invitation email logic
+      },
+      async onInvitationAccepted(data) {
+        // This callback gets triggered when an invitation is accepted
+      },
</file context>

const charset = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
let code = "";
for (let i = 0; i < 8; i++) {
code += charset[Math.floor(Math.random() * charset.length)];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insecure randomness for user code generation; use a cryptographically secure RNG to reduce guessability.

Prompt for AI agents
Address the following comment on docs/content/docs/plugins/device-authorization.mdx at line 397:

<comment>Insecure randomness for user code generation; use a cryptographically secure RNG to reduce guessability.</comment>

<file context>
@@ -0,0 +1,661 @@
+    const charset = &quot;ABCDEFGHJKLMNPQRSTUVWXYZ23456789&quot;;
+    let code = &quot;&quot;;
+    for (let i = 0; i &lt; 8; i++) {
+      code += charset[Math.floor(Math.random() * charset.length)];
+    }
+    return code;
</file context>

page: Page,
fn: ({ client }: { client: Window["client"] }) => R,
): Promise<R> {
const client = await page.evaluateHandle<Window["client"]>("window.client");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSHandle created for window.client is never disposed, which can leak resources across tests.

Prompt for AI agents
Address the following comment on e2e/integration/vanilla-node/e2e/utils.ts at line 20:

<comment>JSHandle created for window.client is never disposed, which can leak resources across tests.</comment>

<file context>
@@ -0,0 +1,82 @@
+	page: Page,
+	fn: ({ client }: { client: Window[&quot;client&quot;] }) =&gt; R,
+): Promise&lt;R&gt; {
+	const client = await page.evaluateHandle&lt;Window[&quot;client&quot;]&gt;(&quot;window.client&quot;);
+	return page.evaluate(fn, { client });
+}
</file context>


setError(null);

startDenyTransition(async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async useTransition callback won’t track the pending async work; isDenyPending likely never reflects the request, so the Deny button may not disable or show a spinner.

Prompt for AI agents
Address the following comment on demo/nextjs/app/device/approve/page.tsx at line 42:

<comment>Async useTransition callback won’t track the pending async work; isDenyPending likely never reflects the request, so the Deny button may not disable or show a spinner.</comment>

<file context>
@@ -0,0 +1,122 @@
+
+		setError(null);
+
+		startDenyTransition(async () =&gt; {
+			try {
+				await client.device.deny({
</file context>


setError(null);

startApproveTransition(async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async useTransition callback won’t track the pending async work; isApprovePending likely never reflects the request, so the Approve button may not disable or show a spinner.

Prompt for AI agents
Address the following comment on demo/nextjs/app/device/approve/page.tsx at line 25:

<comment>Async useTransition callback won’t track the pending async work; isApprovePending likely never reflects the request, so the Approve button may not disable or show a spinner.</comment>

<file context>
@@ -0,0 +1,122 @@
+
+		setError(null);
+
+		startApproveTransition(async () =&gt; {
+			try {
+				await client.device.approve({
</file context>

To list the organizations that a user is a member of, you can use `useListOrganizations` hook. It implements a reactive way to get the organizations that the user is a member of.

<Tabs items={["React", "Vue", "Svelte"]} defaultValue="React">
<Tabs items={["React", "Vue", "Svelte"]} default="React">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs component likely expects defaultValue, not default; this will break default tab selection.

Prompt for AI agents
Address the following comment on docs/content/docs/plugins/organization.mdx at line 516:

<comment>Tabs component likely expects defaultValue, not default; this will break default tab selection.</comment>

<file context>
@@ -137,75 +141,391 @@ type checkOrganizationSlug = {
 To list the organizations that a user is a member of, you can use `useListOrganizations` hook. It implements a reactive way to get the organizations that the user is a member of.
 
-&lt;Tabs items={[&quot;React&quot;, &quot;Vue&quot;, &quot;Svelte&quot;]} defaultValue=&quot;React&quot;&gt;
+&lt;Tabs items={[&quot;React&quot;, &quot;Vue&quot;, &quot;Svelte&quot;]} default=&quot;React&quot;&gt;
 &lt;Tab value=&quot;React&quot;&gt;
 ```tsx title=&quot;client.tsx&quot;
</file context>
Suggested change
<Tabs items={["React", "Vue", "Svelte"]} default="React">
<Tabs items={["React", "Vue", "Svelte"]} defaultValue="React">

@himself65
Copy link
Copy Markdown
Contributor Author

Remind to use rebase merge (NOT SQUASH) when you think everything is ready /cc @Bekacru

@Bekacru Bekacru merged commit 1cabe4a into main Sep 4, 2025
9 checks passed
@himself65 himself65 deleted the v1.3.8-staging branch September 4, 2025 01:53
@better-auth better-auth locked as resolved and limited conversation to collaborators Apr 1, 2026
@bytaesu bytaesu added the locked Locked conversations after being closed for 7 days label Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked Locked conversations after being closed for 7 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.