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.5 KiB

{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport getConfig from \"next/config\";\nimport * as jwt from \"jsonwebtoken\";\n\nvar Config = /*#__PURE__*/function () {\n function Config(data) {\n _classCallCheck(this, Config);\n\n _defineProperty(this, \"data\", void 0);\n\n this.data = data;\n }\n\n _createClass(Config, [{\n key: \"auth0\",\n value: function 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 key: \"session\",\n value: function session() {\n return this.data.session;\n }\n }, {\n key: \"apiUrl\",\n value: function apiUrl(path) {\n return this.data.api.urlRoot + path;\n }\n }, {\n key: \"jwtToken\",\n value: function jwtToken(username) {\n var expiry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 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 return Config;\n}();\n\nvar config = new Config(getConfig().serverRuntimeConfig);\nexport default config;","map":null,"metadata":{},"sourceType":"module"}