From e6fdd6f1d2d1192223aaa5bf378ca6f6d767c293 Mon Sep 17 00:00:00 2001
From: Mohammad Torkashvand <mohammad.torkashvand@geant.org>
Date: Wed, 28 Aug 2024 16:06:20 +0200
Subject: [PATCH] add mising NEXTAUTH_TOKEN_ENDPOINT

---
 .env.local.example              | 1 +
 pages/api/auth/[...nextauth].ts | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.env.local.example b/.env.local.example
index ac5d307..04412a4 100644
--- a/.env.local.example
+++ b/.env.local.example
@@ -17,6 +17,7 @@ NEXTAUTH_CLIENT_SECRET="YOUR_OIDC_CLIENT_SECRET"
 NEXTAUTH_SECRET="SOhxHLn53mV7ML7y8L6rL5oOQxOVb0V4p2Ez0ZSIuOs=" # openssl rand -base64 32
 NEXTAUTH_ISSUER="https://proxy.aai.geant.org"
 NEXTAUTH_WELL_KNOWN_OVERRIDE="https://proxy.aai.geant.org/.well-known/openid-configuration"
+NEXTAUTH_TOKEN_ENDPOINT="https://proxy.aai.geant.org/OIDC/token"
 
 # docker-compose variables
 # KEYCLOAK_ADMIN=admin
diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts
index 2a53072..7fd5f35 100644
--- a/pages/api/auth/[...nextauth].ts
+++ b/pages/api/auth/[...nextauth].ts
@@ -21,7 +21,7 @@ async function refreshAccessToken(token: JWT): Promise<JWT> {
       refresh_token: token.refreshToken as string,
     });
 
-    const response = await fetch(process.env.TOKEN_ENDPOINT!, {
+    const response = await fetch(process.env.NEXTAUTH_TOKEN_ENDPOINT!, {
       method: 'POST',
       headers: {
         'Content-Type': 'application/json',
-- 
GitLab