@betterstart/cli 0.1.63 → 0.1.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -8694,6 +8694,7 @@ export const { signIn, signUp, signOut, useSession } = authClient
|
|
|
8694
8694
|
function authMiddlewareTemplate() {
|
|
8695
8695
|
return `import { headers } from 'next/headers'
|
|
8696
8696
|
import { redirect } from 'next/navigation'
|
|
8697
|
+
import { connection } from 'next/server'
|
|
8697
8698
|
import { auth, type User } from './auth'
|
|
8698
8699
|
|
|
8699
8700
|
export enum UserRole {
|
|
@@ -8710,6 +8711,7 @@ export function isUserRole(value: unknown): value is UserRole {
|
|
|
8710
8711
|
* Get the current session from Better Auth
|
|
8711
8712
|
*/
|
|
8712
8713
|
export async function getSession() {
|
|
8714
|
+
await connection()
|
|
8713
8715
|
const session = await auth.api.getSession({
|
|
8714
8716
|
headers: await headers(),
|
|
8715
8717
|
})
|
|
@@ -15631,6 +15633,8 @@ var TEMPLATE_REGISTRY = {
|
|
|
15631
15633
|
validation: { relPath: "utils/validation.ts", content: validationUtilTemplate },
|
|
15632
15634
|
webhook: { relPath: "utils/webhook.ts", content: webhookUtilTemplate },
|
|
15633
15635
|
mailchimp: { relPath: "utils/mailchimp.ts", content: mailchimpUtilTemplate },
|
|
15636
|
+
// Auth
|
|
15637
|
+
"auth-middleware": { relPath: "lib/auth/middleware.ts", content: authMiddlewareTemplate },
|
|
15634
15638
|
// Lib
|
|
15635
15639
|
r2: { relPath: "lib/r2.ts", content: r2ClientTemplate },
|
|
15636
15640
|
"form-settings-action": { relPath: "lib/actions/form-settings.ts", content: formSettingsActionTemplate },
|