Skip to content

Commit

Permalink
fix(webpage-client): removed secret keys from public NextJS config
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomario committed Oct 23, 2024
1 parent 66bb8b2 commit 0700a23
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clients/packages/webpage-client/src/apis/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const authLink = setContext((_, { headers }) => {
return {
headers: {
...headers,
// 'x-hasura-admin-secret': publicRuntimeConfig.apiGraphqlSecret
// 'x-hasura-admin-secret': serverRuntimeConfig.apiGraphqlSecret
// authorization: token ? `Bearer ${token}` : "",
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import fetch from 'node-fetch';

import Utils from '../Utils';

const { publicRuntimeConfig } = getConfig();
const { serverRuntimeConfig } = getConfig();

// const mapDispatchToProps = () => ({
// createTransaction: async (args: any) =>
Expand Down Expand Up @@ -76,7 +76,7 @@ const DonationConnected = (props: any) =>
})
).json()
}
pagarmeKey={publicRuntimeConfig.pagarmeKey || 'setup env var'}
pagarmeKey={serverRuntimeConfig.pagarmeKey || 'setup env var'}
donationComponent={DonationPlugin}
analyticsEvents={DonationAnalytics}
overrides={{
Expand Down Expand Up @@ -106,7 +106,7 @@ export default DonationConnected;
// )((props: MobProps) => (
// <PagarMeCheckout
// {...props}
// pagarmeKey={publicRuntimeConfig.pagarmeKey || 'setup env var'}
// pagarmeKey={serverRuntimeConfig.pagarmeKey || 'setup env var'}
// donationComponent={DonationPlugin}
// analyticsEvents={DonationAnalytics}
// overrides={{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import getConfig from 'next/config';
import recharge from '../../../apis/rest/recharge';

const { publicRuntimeConfig } = getConfig();
const { serverRuntimeConfig } = getConfig();

const submit = (values: any) => {
//
Expand All @@ -17,7 +17,7 @@ const submit = (values: any) => {
//
const promise = new Promise((resolve, reject) => {
// eslint-disable-next-line
(window as any).PagarMe.encryption_key = publicRuntimeConfig.pagarmeKey;
(window as any).PagarMe.encryption_key = serverRuntimeConfig.pagarmeKey;

// eslint-disable-next-line
const card = new (window as any).PagarMe.creditCard();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ interface Request {
}

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

export default async (req: Request, res: any) => {
if (req.method === 'GET') {
Expand Down

0 comments on commit 0700a23

Please sign in to comment.