From eccdd55c6b0f3bd1e6c9eb475f5a8ba43c32c9ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:41:37 +0000 Subject: [PATCH 01/10] [docker] Bump the vreapis-docker group across 2 directories with 1 update Bumps the vreapis-docker group with 1 update in the /tilt/vreapis directory: python. Bumps the vreapis-docker group with 1 update in the /vreapis directory: python. Updates `python` from 3.12.2-slim to 3.12.5-slim Updates `python` from 3.12.2-slim to 3.12.5-slim --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch dependency-group: vreapis-docker - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch dependency-group: vreapis-docker ... Signed-off-by: dependabot[bot] --- tilt/vreapis/Dockerfile | 2 +- vreapis/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tilt/vreapis/Dockerfile b/tilt/vreapis/Dockerfile index 3d9a92c..788d551 100644 --- a/tilt/vreapis/Dockerfile +++ b/tilt/vreapis/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12.2-slim +FROM python:3.12.5-slim WORKDIR /app diff --git a/vreapis/Dockerfile b/vreapis/Dockerfile index 9c730e6..8138b78 100644 --- a/vreapis/Dockerfile +++ b/vreapis/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12.2-slim +FROM python:3.12.5-slim WORKDIR /app From 68ca609852fad8d5728810f70bb2d1ef10f0c884 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:41:56 +0000 Subject: [PATCH 02/10] [pip] Bump the vreapis-pip group in /vreapis with 7 updates Bumps the vreapis-pip group in /vreapis with 7 updates: | Package | From | To | | --- | --- | --- | | [django](https://github.com/django/django) | `5.0.3` | `5.1` | | [djangorestframework](https://github.com/encode/django-rest-framework) | `3.14.0` | `3.15.2` | | [django-filter](https://github.com/carltongibson/django-filter) | `24.2` | `24.3` | | [whitenoise](https://github.com/evansd/whitenoise) | `6.6.0` | `6.7.0` | | [pyyaml](https://github.com/yaml/pyyaml) | `6.0.1` | `6.0.2` | | [requests](https://github.com/psf/requests) | `2.31.0` | `2.32.3` | | [django-cors-headers](https://github.com/adamchainz/django-cors-headers) | `4.3.1` | `4.4.0` | Updates `django` from 5.0.3 to 5.1 - [Commits](https://github.com/django/django/compare/5.0.3...5.1) Updates `djangorestframework` from 3.14.0 to 3.15.2 - [Release notes](https://github.com/encode/django-rest-framework/releases) - [Commits](https://github.com/encode/django-rest-framework/compare/3.14.0...3.15.2) Updates `django-filter` from 24.2 to 24.3 - [Release notes](https://github.com/carltongibson/django-filter/releases) - [Changelog](https://github.com/carltongibson/django-filter/blob/main/CHANGES.rst) - [Commits](https://github.com/carltongibson/django-filter/compare/24.2...24.3) Updates `whitenoise` from 6.6.0 to 6.7.0 - [Changelog](https://github.com/evansd/whitenoise/blob/main/docs/changelog.rst) - [Commits](https://github.com/evansd/whitenoise/compare/6.6.0...6.7.0) Updates `pyyaml` from 6.0.1 to 6.0.2 - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/main/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/6.0.1...6.0.2) Updates `requests` from 2.31.0 to 2.32.3 - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.31.0...v2.32.3) Updates `django-cors-headers` from 4.3.1 to 4.4.0 - [Changelog](https://github.com/adamchainz/django-cors-headers/blob/main/CHANGELOG.rst) - [Commits](https://github.com/adamchainz/django-cors-headers/compare/4.3.1...4.4.0) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vreapis-pip - dependency-name: djangorestframework dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vreapis-pip - dependency-name: django-filter dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vreapis-pip - dependency-name: whitenoise dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vreapis-pip - dependency-name: pyyaml dependency-type: direct:production update-type: version-update:semver-patch dependency-group: vreapis-pip - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vreapis-pip - dependency-name: django-cors-headers dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vreapis-pip ... Signed-off-by: dependabot[bot] --- vreapis/requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vreapis/requirements.txt b/vreapis/requirements.txt index d46e574..d714961 100644 --- a/vreapis/requirements.txt +++ b/vreapis/requirements.txt @@ -1,13 +1,13 @@ -django==5.0.3 -djangorestframework==3.14.0 +django==5.1 +djangorestframework==3.15.2 djangorestframework-gis==1.0 -django-filter==24.2 -whitenoise==6.6.0 +django-filter==24.3 +whitenoise==6.7.0 gunicorn==22.0.0 -pyyaml==6.0.1 -requests==2.31.0 +pyyaml==6.0.2 +requests==2.32.3 django-dotenv==1.4.2 -django-cors-headers==4.3.1 +django-cors-headers==4.4.0 django-extensions==3.2.3 psycopg2==2.9.9 django-probes==1.7.0 From 45151874ce0809088c5886d58647b3f0b58bfb82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:43:59 +0000 Subject: [PATCH 03/10] [npm] Bump the vre-panel-npm group in /vre-panel with 13 updates Bumps the vre-panel-npm group in /vre-panel with 13 updates: | Package | From | To | | --- | --- | --- | | [@headlessui/react](https://github.com/tailwindlabs/headlessui/tree/HEAD/packages/@headlessui-react) | `1.7.19` | `2.1.2` | | [axios](https://github.com/axios/axios) | `1.6.8` | `1.7.3` | | [keycloak-js](https://github.com/keycloak/keycloak) | `23.0.7` | `25.0.2` | | [next](https://github.com/vercel/next.js) | `13.4.4` | `14.2.5` | | [next-auth](https://github.com/nextauthjs/next-auth) | `4.5.0` | `4.24.7` | | [react](https://github.com/facebook/react/tree/HEAD/packages/react) | `18.2.0` | `18.3.1` | | [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) | `18.2.0` | `18.3.1` | | [typescript](https://github.com/Microsoft/TypeScript) | `4.9.5` | `5.5.4` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.11.30` | `22.1.0` | | [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `18.2.79` | `18.3.3` | | [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) | `1.22.0` | `2.0.0` | | [eslint](https://github.com/eslint/eslint) | `8.57.0` | `9.8.0` | | [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) | `14.1.0` | `14.2.5` | Updates `@headlessui/react` from 1.7.19 to 2.1.2 - [Release notes](https://github.com/tailwindlabs/headlessui/releases) - [Changelog](https://github.com/tailwindlabs/headlessui/blob/main/packages/@headlessui-react/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/headlessui/commits/@headlessui/react@v2.1.2/packages/@headlessui-react) Updates `axios` from 1.6.8 to 1.7.3 - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.6.8...v1.7.3) Updates `keycloak-js` from 23.0.7 to 25.0.2 - [Release notes](https://github.com/keycloak/keycloak/releases) - [Commits](https://github.com/keycloak/keycloak/compare/23.0.7...25.0.2) Updates `next` from 13.4.4 to 14.2.5 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/compare/v13.4.4...v14.2.5) Updates `next-auth` from 4.5.0 to 4.24.7 - [Release notes](https://github.com/nextauthjs/next-auth/releases) - [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@v4.5.0...next-auth@4.24.7) Updates `react` from 18.2.0 to 18.3.1 - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react) Updates `react-dom` from 18.2.0 to 18.3.1 - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react-dom) Updates `typescript` from 4.9.5 to 5.5.4 - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.9.5...v5.5.4) Updates `@types/node` from 20.11.30 to 22.1.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `@types/react` from 18.2.79 to 18.3.3 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) Updates `axios-mock-adapter` from 1.22.0 to 2.0.0 - [Release notes](https://github.com/ctimmerm/axios-mock-adapter/releases) - [Changelog](https://github.com/ctimmerm/axios-mock-adapter/blob/master/CHANGELOG.md) - [Commits](https://github.com/ctimmerm/axios-mock-adapter/compare/v1.22.0...v2.0.0) Updates `eslint` from 8.57.0 to 9.8.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.57.0...v9.8.0) Updates `eslint-config-next` from 14.1.0 to 14.2.5 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/commits/v14.2.5/packages/eslint-config-next) --- updated-dependencies: - dependency-name: "@headlessui/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: vre-panel-npm - dependency-name: axios dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vre-panel-npm - dependency-name: keycloak-js dependency-type: direct:production update-type: version-update:semver-major dependency-group: vre-panel-npm - dependency-name: next dependency-type: direct:production update-type: version-update:semver-major dependency-group: vre-panel-npm - dependency-name: next-auth dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vre-panel-npm - dependency-name: react dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vre-panel-npm - dependency-name: react-dom dependency-type: direct:production update-type: version-update:semver-minor dependency-group: vre-panel-npm - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-major dependency-group: vre-panel-npm - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major dependency-group: vre-panel-npm - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: vre-panel-npm - dependency-name: axios-mock-adapter dependency-type: direct:development update-type: version-update:semver-major dependency-group: vre-panel-npm - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major dependency-group: vre-panel-npm - dependency-name: eslint-config-next dependency-type: direct:development update-type: version-update:semver-minor dependency-group: vre-panel-npm ... Signed-off-by: dependabot[bot] --- vre-panel/package.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/vre-panel/package.json b/vre-panel/package.json index aef2f74..aafdc79 100644 --- a/vre-panel/package.json +++ b/vre-panel/package.json @@ -8,18 +8,18 @@ "lint": "next lint" }, "dependencies": { - "@headlessui/react": "~1.7.17", + "@headlessui/react": "~2.1.2", "@react-keycloak/ssr": "~3.3.0", "@tailwindcss/line-clamp": "latest", - "axios": "~1.6.0", + "axios": "~1.7.3", "clsx": "^2.0.0", "cookie": "~0.6.0", "http": "~0.0.1-security", - "keycloak-js": "~23.0.3", - "next": "13.4.4", - "next-auth": "~4.5.0", - "react": "18.2.0", - "react-dom": "18.2.0", + "keycloak-js": "~25.0.2", + "next": "14.2.5", + "next-auth": "~4.24.7", + "react": "18.3.1", + "react-dom": "18.3.1", "react-markdown": "^9.0.0", "react-scripts": "5.0.1", "tailwindcss": "~3.4.1", @@ -29,14 +29,14 @@ "leaflet": "~1.9.0" }, "devDependencies": { - "typescript": "^4.5", + "typescript": "^5.5", "@tailwindcss/typography": "^0.5.10", - "@types/node": "~20.11.25", - "@types/react": "~18.2.0", + "@types/node": "~22.1.0", + "@types/react": "~18.3.3", "autoprefixer": "~10.4.15", - "axios-mock-adapter": "~1.22.0", - "eslint": "8.57.0", - "eslint-config-next": "14.1.0", + "axios-mock-adapter": "~2.0.0", + "eslint": "9.8.0", + "eslint-config-next": "14.2.5", "postcss": "^8.4.27", "@types/object-hash": "~3.0.0", "@types/leaflet": "~1.9.1" From 6b57a5ca85aea2a32c9c68938011b389776799f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 09:04:31 +0000 Subject: [PATCH 04/10] [docker] Bump node Bumps the vre-panel-docker group with 1 update in the /vre-panel directory: node. Updates `node` from 21-alpine to 22-alpine --- updated-dependencies: - dependency-name: node dependency-type: direct:production dependency-group: vre-panel-docker ... Signed-off-by: dependabot[bot] --- vre-panel/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vre-panel/Dockerfile b/vre-panel/Dockerfile index 471eba0..e19dbe6 100644 --- a/vre-panel/Dockerfile +++ b/vre-panel/Dockerfile @@ -1,5 +1,5 @@ # Install dependencies only when needed -FROM node:21-alpine AS deps +FROM node:22-alpine AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat WORKDIR /app @@ -12,7 +12,7 @@ RUN npm install RUN npm ci # Rebuild the source code only when needed -FROM node:21-alpine AS builder +FROM node:22-alpine AS builder ARG NODE_ENV WORKDIR /app COPY --from=deps /app/node_modules ./node_modules @@ -29,7 +29,7 @@ COPY . . RUN npm run build # Production image, copy all the files and run next -FROM node:21-alpine AS runner +FROM node:22-alpine AS runner WORKDIR /app ENV NODE_ENV production From 848be544db50abe50163e6314d90b2b1611eabbe Mon Sep 17 00:00:00 2001 From: Gabriel Pelouze Date: Thu, 8 Aug 2024 11:27:26 +0200 Subject: [PATCH 05/10] bump node in tilt Dockerfile --- tilt/vre-panel/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tilt/vre-panel/Dockerfile b/tilt/vre-panel/Dockerfile index 761da34..9f7660c 100644 --- a/tilt/vre-panel/Dockerfile +++ b/tilt/vre-panel/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine3.16 +FROM node:22-alpine ARG NODE_ENV=test ENV NODE_ENV $NODE_ENV From 214d8ae3be55d7a6c502659a702921bf0fb7bfc5 Mon Sep 17 00:00:00 2001 From: Gabriel Pelouze Date: Thu, 8 Aug 2024 14:50:13 +0200 Subject: [PATCH 06/10] fix npm version incompatibilities --- vre-panel/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vre-panel/package.json b/vre-panel/package.json index aafdc79..bd0fbbf 100644 --- a/vre-panel/package.json +++ b/vre-panel/package.json @@ -21,7 +21,6 @@ "react": "18.3.1", "react-dom": "18.3.1", "react-markdown": "^9.0.0", - "react-scripts": "5.0.1", "tailwindcss": "~3.4.1", "use-subscription": "~1.8.0", "object-hash": "~3.0.0", @@ -35,7 +34,7 @@ "@types/react": "~18.3.3", "autoprefixer": "~10.4.15", "axios-mock-adapter": "~2.0.0", - "eslint": "9.8.0", + "eslint": "^8", "eslint-config-next": "14.2.5", "postcss": "^8.4.27", "@types/object-hash": "~3.0.0", From 47eb3e82f9ab5b9150a9763794a2f420ac937d8d Mon Sep 17 00:00:00 2001 From: Gabriel Pelouze Date: Thu, 8 Aug 2024 15:20:07 +0200 Subject: [PATCH 07/10] fix code following headlessui update --- vre-panel/components/NewVREDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vre-panel/components/NewVREDialog.tsx b/vre-panel/components/NewVREDialog.tsx index ece241d..b5eadf7 100644 --- a/vre-panel/components/NewVREDialog.tsx +++ b/vre-panel/components/NewVREDialog.tsx @@ -20,7 +20,7 @@ const NewVREDialog = ({ isOpen, setIsOpen }: { isOpen: boolean, setIsOpen: Funct leaveFrom="opacity-100" leaveTo="opacity-0" > - +
{/* This element is to trick the browser into centering the modal contents. */} From d4192f55413145bc582d6f4325c1952230e724b1 Mon Sep 17 00:00:00 2001 From: Gabriel Pelouze Date: Thu, 8 Aug 2024 15:23:21 +0200 Subject: [PATCH 08/10] fix code following next update --- vre-panel/next.config.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vre-panel/next.config.js b/vre-panel/next.config.js index 56ab911..a0c76f2 100644 --- a/vre-panel/next.config.js +++ b/vre-panel/next.config.js @@ -2,9 +2,7 @@ console.log(process.env.NODE_ENV); module.exports = { reactStrictMode: true, - experimental: { - outputStandalone: true - }, + output: "standalone", basePath: process.env.FRONTEND_BASE_PATH, publicRuntimeConfig: { basePath: process.env.FRONTEND_BASE_PATH, From 77f99f33211bc2ab22c19df437ed018bd6a13b3d Mon Sep 17 00:00:00 2001 From: Gabriel Pelouze Date: Thu, 8 Aug 2024 16:40:06 +0200 Subject: [PATCH 09/10] fix code following next-auth update --- vre-panel/components/VLabInstances.tsx | 2 +- vre-panel/next-auth.d.ts | 78 ++--------------------- vre-panel/pages/api/auth/[...nextauth].ts | 16 +++-- 3 files changed, 15 insertions(+), 81 deletions(-) diff --git a/vre-panel/components/VLabInstances.tsx b/vre-panel/components/VLabInstances.tsx index 727e76b..394f3dd 100644 --- a/vre-panel/components/VLabInstances.tsx +++ b/vre-panel/components/VLabInstances.tsx @@ -31,7 +31,7 @@ const VLabInstances: React.FC = ({vlab, slug}) => { return } - const username = session.data.user.name + const username = session.data.user?.name const requestOptions: RequestInit = { method: "POST", diff --git a/vre-panel/next-auth.d.ts b/vre-panel/next-auth.d.ts index 1fc0c0f..568ba3b 100644 --- a/vre-panel/next-auth.d.ts +++ b/vre-panel/next-auth.d.ts @@ -5,86 +5,18 @@ declare module 'next-auth' { * Returned by `useSession`, `getSession` and received as a prop on the `Provider` React Context */ interface Session { - user: { - sub: string; - email_verified: boolean; - name: string; - preferred_username: string; - given_name: string; - family_name: string; - email: string; - id: string; - org_name?: string; - telephone?: string; - }; + accessToken?: string; + accessTokenExpiry?: number; error: string; - accessTokenExpiry: number; - } - /** - * The shape of the user object returned in the OAuth providers' `profile` callback, - * or the second parameter of the `session` callback, when using a database. - */ - interface User { - sub: string; - email_verified: boolean; - name: string; - telephone: string; - preferred_username: string; - org_name: string; - given_name: string; - family_name: string; - email: string; - id: string; - } - /** - * Usually contains information about the provider being used - * and also extends `TokenSet`, which is different tokens returned by OAuth Providers. - */ - interface Account { - provider: string; - type: string; - id: string; - accessToken: string; - accessTokenExpires?: any; - refreshToken: string; - idToken: string; - access_token: string; - expires_at: number; - refresh_expires_in: number; - refresh_token: string; - token_type: string; - id_token: string; - 'not-before-policy': number; - session_state: string; - scope: string; - } - /** The OAuth profile returned from your provider */ - interface Profile { - sub: string; - email_verified: boolean; - name: string; - telephone: string; - preferred_username: string; - org_name: string; - given_name: string; - family_name: string; - email: string; } } declare module 'next-auth/jwt' { /** Returned by the `jwt` callback and `getToken`, when using JWT sessions */ interface JWT { - name: string; - email: string; - sub: string; - name: string; - email: string; - sub: string; - accessToken: string; - refreshToken: string; - accessTokenExpiry: number; - user: User; + accessToken?: string; + refreshToken?: string; + accessTokenExpiry?: number; error: string; } } \ No newline at end of file diff --git a/vre-panel/pages/api/auth/[...nextauth].ts b/vre-panel/pages/api/auth/[...nextauth].ts index b137ef9..66ef9fb 100644 --- a/vre-panel/pages/api/auth/[...nextauth].ts +++ b/vre-panel/pages/api/auth/[...nextauth].ts @@ -1,5 +1,6 @@ import axios from "axios"; import NextAuth from "next-auth" +import { Session } from "next-auth"; import { JWT } from "next-auth/jwt"; import KeycloakProvider from "next-auth/providers/keycloak" import type { NextApiRequest, NextApiResponse } from 'next' @@ -64,18 +65,19 @@ export default (req : NextApiRequest, res: NextApiResponse) => { token.accessTokenExpiry = account.expires_at; } - const expDate = new Date(token.accessTokenExpiry * 1e3) - const nowDate = new Date() - const tokenExpired = (expDate < nowDate) - - if (tokenExpired) { - token = await refreshAccessToken(token); + if (token.accessTokenExpiry) { + const expDate = new Date(token.accessTokenExpiry * 1e3) + const nowDate = new Date() + const tokenExpired = (expDate < nowDate) + if (tokenExpired) { + token = await refreshAccessToken(token); + } } return token; }, - async session({ session, token }) { + async session({ session, token }: { session: Session, token: JWT }) { if (token) { session.error = token.error; session.accessToken = token.accessToken; From cdf09a869ea12dd3ab2455e5b9f2167f2951979b Mon Sep 17 00:00:00 2001 From: Gabriel Pelouze Date: Fri, 9 Aug 2024 10:18:25 +0200 Subject: [PATCH 10/10] fix docker healthcheck --- vre-panel/docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/vre-panel/docker-compose.yaml b/vre-panel/docker-compose.yaml index 65109b5..6082258 100644 --- a/vre-panel/docker-compose.yaml +++ b/vre-panel/docker-compose.yaml @@ -8,6 +8,7 @@ services: - AUTH0_ID= - AUTH0_ISSUER= - SECRET=secret + - HOSTNAME=localhost ports: - '127.0.0.1:3000:3000' healthcheck: