From 98f762d31e279adbf069d0ba0627f552b6a603a1 Mon Sep 17 00:00:00 2001 From: andrzej Date: Fri, 13 Sep 2024 21:53:27 +0200 Subject: [PATCH] make it a server component --- src/app/api/auth/actions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/api/auth/actions.ts b/src/app/api/auth/actions.ts index 8981f1b..712da5c 100644 --- a/src/app/api/auth/actions.ts +++ b/src/app/api/auth/actions.ts @@ -1,9 +1,10 @@ +"use server" import prisma from 'app/lib/db'; import { jwtVerify, JWTPayload, decodeJwt } from 'jose'; import { cookies } from 'next/headers'; -export function getJWTSecretKey() { +export async function getJWTSecretKey() { const secret = process.env.JWT_SECRET if (!secret) throw new Error("There is no JWT secret key") return new TextEncoder().encode(secret) @@ -64,7 +65,7 @@ export async function logout() { return null } -export function setUserDataCookie(userData) { +export async function setUserDataCookie(userData) { const cookieStore = cookies(); cookieStore.set({ name: 'userData',