diff --git a/packages/db/src/auth/plugins/login-link.ts b/packages/db/src/auth/plugins/login-link.ts index 9edf1fb7..8c8434fa 100644 --- a/packages/db/src/auth/plugins/login-link.ts +++ b/packages/db/src/auth/plugins/login-link.ts @@ -1,5 +1,6 @@ import * as schema from '@db/schema'; +import type { BetterAuthPlugin } from 'better-auth'; import { createAuthEndpoint } from 'better-auth/api'; import { setSessionCookie as _setSessionCookie } from 'better-auth/cookies'; const setSessionCookie = _setSessionCookie as ( @@ -30,7 +31,7 @@ function getLoginLinkSecret(): Uint8Array { return new TextEncoder().encode(secret); } -export function loginLink() { +export function loginLink(): BetterAuthPlugin { return { id: 'login-link', endpoints: { diff --git a/packages/db/src/auth/plugins/token-exchange.ts b/packages/db/src/auth/plugins/token-exchange.ts index 98febbee..5c129213 100644 --- a/packages/db/src/auth/plugins/token-exchange.ts +++ b/packages/db/src/auth/plugins/token-exchange.ts @@ -1,5 +1,6 @@ import * as schema from '@db/schema'; +import type { BetterAuthPlugin } from 'better-auth'; import { createAuthEndpoint } from 'better-auth/api'; // Session cookie helper: runtime accepts (ctx, { session, user }), typings show 1 arg import { setSessionCookie as _setSessionCookie } from 'better-auth/cookies'; @@ -21,7 +22,7 @@ function generateToken(): string { return Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join(''); } -export function tokenExchange() { +export function tokenExchange(): BetterAuthPlugin { return { id: 'token-exchange', endpoints: {