Finalizes option to secure backend http endpoints with a token
- Also fixes to build commands in makefile
This commit is contained in:
parent
e6c2042df6
commit
4e20c4ac56
7 changed files with 24 additions and 17 deletions
|
@ -1,20 +1,21 @@
|
|||
interface Config {
|
||||
GENERAL: {
|
||||
SUPER_SECRET_KEY: string;
|
||||
NEXT_PUBLIC_SUPER_SECRET_KEY: string;
|
||||
NEXT_PUBLIC_API_URL: string;
|
||||
NEXT_PUBLIC_WS_URL: string;
|
||||
};
|
||||
}
|
||||
|
||||
const loadEnv = () => {
|
||||
return {
|
||||
GENERAL: {
|
||||
SUPER_SECRET_KEY: process.env.SUPER_SECRET_KEY!,
|
||||
NEXT_PUBLIC_SUPER_SECRET_KEY: process.env.NEXT_PUBLIC_SUPER_SECRET_KEY!,
|
||||
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL!,
|
||||
NEXT_PUBLIC_WS_URL: process.env.NEXT_PUBLIC_WS_URL!
|
||||
},
|
||||
} as Config;
|
||||
};
|
||||
|
||||
export const getAccessKey = () => loadEnv().GENERAL.SUPER_SECRET_KEY;
|
||||
export const getAccessKey = () => loadEnv().GENERAL.NEXT_PUBLIC_SUPER_SECRET_KEY;
|
||||
|
||||
export const getBackendURL = () => loadEnv().GENERAL.NEXT_PUBLIC_API_URL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue