change order of env variable
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 8m48s
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 8m48s
This commit is contained in:
@@ -11,7 +11,8 @@ interface NextContext {
|
|||||||
const environment = process.env.NODE_ENV || "development";
|
const environment = process.env.NODE_ENV || "development";
|
||||||
|
|
||||||
const isValidApiKey = (apiKey: string): boolean => {
|
const isValidApiKey = (apiKey: string): boolean => {
|
||||||
const envApiKey = process.env.NEXT_PUBLIC_API_TOKEN || process.env.API_TOKEN;
|
const envApiKey =
|
||||||
|
process.env.API_TOKEN || process.env.NEXT_PUBLIC_API_TOKEN || "";
|
||||||
|
|
||||||
return apiKey === envApiKey;
|
return apiKey === envApiKey;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ export default function RootLayout({
|
|||||||
suspense: true,
|
suspense: true,
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
headers: {
|
headers: {
|
||||||
"x-api-key": process.env?.NEXT_PUBLIC_API_TOKEN || ""
|
"x-api-key":
|
||||||
|
process.env?.API_TOKEN || process.env?.NEXT_PUBLIC_API_TOKEN || ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user