Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
1.1 KiB

{"ast":null,"code":"function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport getConfig from \"next/config\";\nimport * as jwt from \"jsonwebtoken\";\n\nclass Config {\n constructor(data) {\n _defineProperty(this, \"data\", void 0);\n\n this.data = data;\n }\n\n auth0() {\n return {\n clientId: this.data.auth0.clientId,\n clientSecret: this.data.auth0.secret,\n domain: this.data.auth0.domain\n };\n }\n\n session() {\n return this.data.session;\n }\n\n apiUrl(path) {\n return this.data.api.urlRoot + path;\n }\n\n jwtToken(username, expiry = 15) {\n return jwt.sign({\n user: username,\n exp: Math.floor(Date.now() / 1000 + expiry)\n }, this.data.api.secretKey, {\n header: {\n kid: this.data.api.secretId\n }\n });\n }\n\n}\n\nconst config = new Config(getConfig().serverRuntimeConfig);\nexport default config;","map":null,"metadata":{},"sourceType":"module"}