From d217f5c7f9c72db17eb235768914b8893c34800b Mon Sep 17 00:00:00 2001 From: Heiko Burkhardt Date: Wed, 8 Nov 2023 09:09:10 +0100 Subject: [PATCH] fix: disable session check for billboard --- .github/workflows/deploy-billboard.yml | 1 + packages/backend/src/index.ts | 1 + packages/backend/src/profile.ts | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/deploy-billboard.yml b/.github/workflows/deploy-billboard.yml index 433b1004f..50434c2a4 100644 --- a/.github/workflows/deploy-billboard.yml +++ b/.github/workflows/deploy-billboard.yml @@ -52,6 +52,7 @@ jobs: echo "RPC=${{ secrets.STAGING_RPC }}" >> ./.env echo "BILLBOARD_PRIVATE_KEY=${{ secrets.BILLBOARD_PRIVATE_KEY}}" >> ./.env echo "interceptor=${{ secrets.INTERCEPTOR}}" >> ./.env + echo "DISABLE_SESSION_CHECK='true'" >> ./.env envsubst '${SSL_CERTIFICATE_BASE_LOC} ${TLS_CERTIFICATE_LOCATION} ${TARGET_HOST}' < ./docker/nginx.conf > ./nginx.conf cat ./.env - name: Build docker image diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 63c04ae80..568cfdaa4 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -16,6 +16,7 @@ import Profile from './profile'; import RpcProxy from './rpc/rpc-proxy'; import Storage from './storage'; import { logInfo } from 'dm3-lib-shared'; +import 'dotenv/config'; import { errorHandler, diff --git a/packages/backend/src/profile.ts b/packages/backend/src/profile.ts index c22baf2ec..0599ce45e 100644 --- a/packages/backend/src/profile.ts +++ b/packages/backend/src/profile.ts @@ -49,8 +49,14 @@ export default () => { method: 'POST', url: req.url, ensName, + disableSessionCheck: + 'value ' + process.env.DISABLE_SESSION_CHECK, + disableSessionCheckBool: + process.env.DISABLE_SESSION_CHECK === 'true', }); + console.log('process: ', process.env); + const data = await submitUserProfile( req.app.locals.web3Provider, req.app.locals.db.getSession, @@ -69,6 +75,10 @@ export default () => { res.json(data); } catch (e) { + global.logger.warn({ + message: 'POST profile', + error: JSON.stringify(e), + }); res.status(400).send({ message: `Couldn't store profile`, error: JSON.stringify(e),