From 099abc24c27422d16377eeeb8a67abc5ba53fb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Huchet?= Date: Mon, 28 Mar 2022 15:00:11 +0200 Subject: [PATCH] chore(dashboard): accept env org key local (#535) * chore(dashboard): accept env org key local * Update dashboard/src/scenes/auth/signin.js Co-authored-by: Arnaud Ambroselli <31724752+arnaudambro@users.noreply.github.com> * Update dashboard/src/scenes/auth/signin.js Co-authored-by: Arnaud Ambroselli <31724752+arnaudambro@users.noreply.github.com> * Update dashboard/src/config.js Co-authored-by: Arnaud Ambroselli <31724752+arnaudambro@users.noreply.github.com> * Update dashboard/src/config.js Co-authored-by: Arnaud Ambroselli <31724752+arnaudambro@users.noreply.github.com> Co-authored-by: Arnaud Ambroselli <31724752+arnaudambro@users.noreply.github.com> --- dashboard/src/config.js | 3 ++- dashboard/src/scenes/auth/signin.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dashboard/src/config.js b/dashboard/src/config.js index 2ffb4df92..6cd1a3840 100644 --- a/dashboard/src/config.js +++ b/dashboard/src/config.js @@ -31,5 +31,6 @@ const HOST = getHost(); const SCHEME = process.env.NODE_ENV === 'development' || process.env.REACT_APP_TEST === 'true' ? process.env.REACT_APP_SCHEME : 'https'; const ENV = process.env.NODE_ENV || 'production'; const VERSION = version; +const DEFAULT_ORGANISATION_KEY = ENV === 'development' ? process.env.REACT_APP_DEFAULT_ORGANISATION_KEY : ''; -export { theme, HOST, SCHEME, ENV, VERSION }; +export { theme, HOST, SCHEME, ENV, VERSION, DEFAULT_ORGANISATION_KEY }; diff --git a/dashboard/src/scenes/auth/signin.js b/dashboard/src/scenes/auth/signin.js index 30b5ebae4..1cd5354e8 100644 --- a/dashboard/src/scenes/auth/signin.js +++ b/dashboard/src/scenes/auth/signin.js @@ -10,7 +10,7 @@ import { useRecoilState, useSetRecoilState } from 'recoil'; import { detect } from 'detect-browser'; import { version } from '../../../package.json'; import ButtonCustom from '../../components/ButtonCustom'; -import { theme } from '../../config'; +import { DEFAULT_ORGANISATION_KEY, theme } from '../../config'; import PasswordInput from '../../components/PasswordInput'; import { currentTeamState, organisationState, teamsState, usersState, userState } from '../../recoil/auth'; import useApi, { setOrgEncryptionKey } from '../../services/api'; @@ -106,7 +106,7 @@ const SignIn = () => { {userName ? `Bienvenue ${userName?.split(' ')?.[0]} !` : 'Bienvenue !'} { try { const body = {