Skip to content

Commit

Permalink
fix(webpage-client): removed open api key from public config
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomario committed Oct 28, 2024
1 parent b342aeb commit abeb44b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
12 changes: 7 additions & 5 deletions clients/packages/webpage-client/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ module.exports = withTM(
// So, the source code is "basePath-ready".
// You can remove `basePath` if you don't need it.
reactStrictMode: true,
// Variáveis acessíveis apenas no servidor (não expostas no cliente)
serverRuntimeConfig: {
apiGraphqlSecret: process.env.REACT_APP_API_GRAPHQL_SECRET,
pagarmeKey: process.env.REACT_APP_PAGARME_KEY,
openApiToken: process.env.REACT_APP_OPENAPI_TOKEN,
},
publicRuntimeConfig: {
domainImaginary: process.env.REACT_APP_DOMAIN_IMAGINARY,
domainApiRest: process.env.REACT_APP_DOMAIN_API_REST,
domainApiGraphql: process.env.REACT_APP_DOMAIN_API_GRAPHQL,
apiGraphqlSecret: process.env.REACT_APP_API_GRAPHQL_SECRET,
domainApiGraphqlWs: process.env.REACT_APP_DOMAIN_API_GRAPHQL_WS,
domainPublic: process.env.REACT_APP_DOMAIN_PUBLIC,
pagarmeKey: process.env.REACT_APP_PAGARME_KEY,

openApiUrl: process.env.REACT_APP_OPENAPI_URL,
openApiToken: process.env.REACT_APP_OPENAPI_TOKEN,
openApiCampaignId: process.env.REACT_APP_OPENAPI_CAMPAIGN_ID
},
})
);
);
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ interface Request {
}

const {
publicRuntimeConfig: {
openApiUrl,
openApiToken,
openApiCampaignId
}
} = getConfig()
publicRuntimeConfig: { openApiUrl, openApiCampaignId },
serverRuntimeConfig: { openApiToken }
} = getConfig();

const campaign_id = openApiCampaignId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ interface Request {
}

const {
publicRuntimeConfig: {
openApiUrl,
openApiToken,
openApiCampaignId
}
} = getConfig()
publicRuntimeConfig: { openApiUrl, openApiCampaignId },
serverRuntimeConfig: { openApiToken }
} = getConfig();

const campaign_id = openApiCampaignId;

Expand Down

0 comments on commit abeb44b

Please sign in to comment.