* chore: inject enviroment at the deployment phase (#2174) * Dockerfile CMD env.sh * env.sh generates env-config.js file * index.html imports env-config.js * front/src/config/index.ts imports REACT_APP_SERVER_BASE_URL * Upgrade Dockerfiles * Add compute pg_database_url for render * fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -4,6 +4,7 @@ import { ApolloClient, InMemoryCache } from '@apollo/client';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { tokenPairState } from '@/auth/states/tokenPairState';
|
||||
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
||||
|
||||
import { ApolloMetadataClientContext } from '../context/ApolloClientMetadataContext';
|
||||
|
||||
@ -17,7 +18,7 @@ export const ApolloMetadataClientProvider = ({
|
||||
const apolloMetadataClient = useMemo(() => {
|
||||
if (tokenPair?.accessToken.token) {
|
||||
return new ApolloClient({
|
||||
uri: `${process.env.REACT_APP_SERVER_BASE_URL}/metadata`,
|
||||
uri: `${REACT_APP_SERVER_BASE_URL}/metadata`,
|
||||
cache: new InMemoryCache(),
|
||||
headers: {
|
||||
Authorization: `Bearer ${tokenPair.accessToken.token}`,
|
||||
|
||||
Reference in New Issue
Block a user