From 427feacedcdc511fcead8d2289264aa58bafd038 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 4 Oct 2023 15:34:39 +0700 Subject: set tier auth --- src/pages/shop/product/[slug].jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pages/shop') diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx index 534aa8da..7351da2f 100644 --- a/src/pages/shop/product/[slug].jsx +++ b/src/pages/shop/product/[slug].jsx @@ -18,10 +18,11 @@ export async function getServerSideProps(context) { const cookies = context.req.headers.cookie const cookieObj = cookies ? cookie.parse(cookies) : {} const auth = cookieObj.auth ? JSON.parse(cookieObj.auth) : {} + const tier = auth.pricelist const authToken = auth?.token || '' let response = await axios( - `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/product-detail?id=` + getIdFromSlug(slug) + `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/product-detail?id=` + getIdFromSlug(slug) +'&auth=' + tier ) let product = response.data // let productSolr = await productApi({ id: getIdFromSlug(slug), headers: { Token: authToken } }) -- cgit v1.2.3