fix: use Web Crypto API in middleware (Edge Runtime compat)
All checks were successful
Deploy / deploy (push) Successful in 2m34s

This commit is contained in:
Cosmo
2026-04-22 19:12:19 +00:00
parent bdbf0f363e
commit c7fc4d6e8e
2 changed files with 12 additions and 9 deletions

View File

@@ -1,5 +1,4 @@
import { NextResponse } from 'next/server'
import { cookies } from 'next/headers'
import * as crypto from 'crypto'
const SECRET = process.env.APP_SECRET || 'smart-home-default-secret-change-me'
@@ -24,7 +23,7 @@ export async function POST(req: Request) {
secure: true,
sameSite: 'strict',
path: '/',
maxAge: 60 * 60 * 24 * 365, // 1 year — tablet stays logged in
maxAge: 60 * 60 * 24 * 365,
})
return res