fix ( middleware )
deskripsi: - fix access api melalui middleware di: home, profile dan portofolio
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"use server";
|
||||
|
||||
import { jwtVerify } from "jose";
|
||||
import { cookies } from "next/headers";
|
||||
import { decrypt } from "../../../../app/auth/_lib/decrypt";
|
||||
|
||||
@@ -16,21 +15,3 @@ export async function funGetUserIdByToken() {
|
||||
return cekUser?.id;
|
||||
}
|
||||
|
||||
// async function decrypt({
|
||||
// token,
|
||||
// encodedKey,
|
||||
// }: {
|
||||
// token: string;
|
||||
// encodedKey: string;
|
||||
// }): Promise<Record<string, any> | null> {
|
||||
// try {
|
||||
// const enc = new TextEncoder().encode(encodedKey);
|
||||
// const { payload } = await jwtVerify(token, enc, {
|
||||
// algorithms: ["HS256"],
|
||||
// });
|
||||
// return (payload.user as Record<string, any>) || null;
|
||||
// } catch (error) {
|
||||
// console.error("Gagal verifikasi session", error);
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user