From d172d651c40ac54520f5d9448488bfe85fd7c99c Mon Sep 17 00:00:00 2001 From: NamH Date: Fri, 8 Sep 2023 02:24:37 -0700 Subject: [PATCH] fix: next-auth production warning for no secret key (#81) * fix: next-auth production warning for no secret key Signed-off-by: James * Fix warning .next folder not exist --------- Signed-off-by: James Co-authored-by: James Co-authored-by: Hien To <> --- web-client/Dockerfile | 2 +- web-client/app/api/auth/[...nextauth]/route.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web-client/Dockerfile b/web-client/Dockerfile index 8b1843602..91992c5e9 100644 --- a/web-client/Dockerfile +++ b/web-client/Dockerfile @@ -34,7 +34,7 @@ COPY --from=builder /app/public ./public # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing -# COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next +COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package.json ./package.json diff --git a/web-client/app/api/auth/[...nextauth]/route.ts b/web-client/app/api/auth/[...nextauth]/route.ts index 81164e7bb..474673d8b 100644 --- a/web-client/app/api/auth/[...nextauth]/route.ts +++ b/web-client/app/api/auth/[...nextauth]/route.ts @@ -34,6 +34,7 @@ export const authOptions = { issuer: `${process.env.AUTH_ISSUER}`, }), ], + secret: `${process.env.NEXTAUTH_SECRET}`, callbacks: { async jwt({ token, account }) { const nowTimestamp = Math.floor(Date.now() / 1000);