Fix: Cookies
This commit is contained in:
@@ -5,14 +5,14 @@ import { ServerEnv } from "@/app/lib/server_env";
|
||||
import { unsealData } from "iron-session";
|
||||
import _ from "lodash";
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
|
||||
export async function user_funGetOneUserId(): Promise<string | null> {
|
||||
try {
|
||||
const kukis = cookies();
|
||||
const c = kukis.get("mySession");
|
||||
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value))
|
||||
return redirect(RouterAuth.login);
|
||||
// if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value))
|
||||
// return re-di-re-ct(RouterAuth.login);
|
||||
|
||||
const token = JSON.parse(
|
||||
await unsealData(c?.value as string, {
|
||||
|
||||
Reference in New Issue
Block a user