Skip to content

Commit

Permalink
chore(dashboard): accept env org key local (#535)
Browse files Browse the repository at this point in the history
* chore(dashboard): accept env org key local

* Update dashboard/src/scenes/auth/signin.js

Co-authored-by: Arnaud Ambroselli <[email protected]>

* Update dashboard/src/scenes/auth/signin.js

Co-authored-by: Arnaud Ambroselli <[email protected]>

* Update dashboard/src/config.js

Co-authored-by: Arnaud Ambroselli <[email protected]>

* Update dashboard/src/config.js

Co-authored-by: Arnaud Ambroselli <[email protected]>

Co-authored-by: Arnaud Ambroselli <[email protected]>
  • Loading branch information
rap2hpoutre and arnaudambro authored Mar 28, 2022
1 parent 6885960 commit 099abc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dashboard/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
4 changes: 2 additions & 2 deletions dashboard/src/scenes/auth/signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -106,7 +106,7 @@ const SignIn = () => {
<AuthWrapper>
<Title>{userName ? `Bienvenue ${userName?.split(' ')?.[0]} !` : 'Bienvenue !'}</Title>
<Formik
initialValues={{ email: '', password: '', orgEncryptionKey: '' }}
initialValues={{ email: '', password: '', orgEncryptionKey: DEFAULT_ORGANISATION_KEY || '' }}
onSubmit={async (values, actions) => {
try {
const body = {
Expand Down

0 comments on commit 099abc2

Please sign in to comment.