silverwolf-x's picture
download
raw
289 Bytes
import { cookies } from 'next/headers'
export function validator(action) {
return async function (arg) {
'use server'
const auth = (await cookies()).get('edge-auth')
if (auth?.value !== '1') {
throw new Error('Unauthorized request')
}
return action(arg)
}
}

Xet Storage Details

Size:
289 Bytes
·
Xet hash:
9bf2dea07e908999beb94df0d5e3fe4148de72cf4040036358ca35745f1f315b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.