diff --git a/.env b/.env new file mode 100644 index 0000000..781c7cd --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VUE_APP_BACKEND_URL= diff --git a/controllers/authController.js b/controllers/authController.js index d20ab85..fd7de88 100644 --- a/controllers/authController.js +++ b/controllers/authController.js @@ -49,7 +49,6 @@ exports.login = async (req, res) => { res.status(200).json({ message: 'Login erfolgreich', token, 'user': user }); } catch (error) { - console.log(error); res.status(500).json({ message: 'Ein Fehler ist aufgetreten' }); } }; diff --git a/controllers/eventPlaceController.js b/controllers/eventPlaceController.js index 2a2b5e0..7ebc1d0 100644 --- a/controllers/eventPlaceController.js +++ b/controllers/eventPlaceController.js @@ -15,8 +15,6 @@ const createEventPlace = async (req, res) => { res.status(201).json(eventPlace); } catch (error) { res.status(500).json({ error: 'Failed to create event place' }); - console.log(req.body); - console.log(error); } }; diff --git a/package-lock.json b/package-lock.json index f7c7a88..546fed4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,12 +27,15 @@ "body-parser": "^1.20.2", "core-js": "^3.8.3", "cors": "^2.8.5", + "crypto": "^1.0.1", + "dotenv": "^16.4.5", "express": "^4.19.2", "jsonwebtoken": "^9.0.2", "mysql2": "^3.10.1", "nodemon": "^3.1.3", "sequelize": "^6.37.3", "sequelize-cli": "^6.6.2", + "vm-browserify": "^1.1.2", "vue": "^3.2.13", "vue-multiselect": "^3.0.0", "vue-quill-editor": "^3.0.6", @@ -45,8 +48,13 @@ "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", + "crypto-browserify": "^3.12.0", "eslint": "^7.32.0", - "eslint-plugin-vue": "^8.0.3" + "eslint-plugin-vue": "^8.0.3", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "stream-browserify": "^3.0.0", + "webpack": "^5.92.0" } }, "node_modules/@achrinza/node-ipc": { @@ -3402,6 +3410,15 @@ } } }, + "node_modules/@vue/cli-service/node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/@vue/cli-shared-utils": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-5.0.8.tgz", @@ -4139,6 +4156,23 @@ "node": ">=8" } }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -4370,6 +4404,12 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, "node_modules/body-parser": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", @@ -4442,6 +4482,116 @@ "node": ">=8" } }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/browserify-sign/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/browserslist": { "version": "4.23.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", @@ -4509,6 +4659,12 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -4670,6 +4826,16 @@ "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", "dev": true }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/clean-css": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", @@ -5144,6 +5310,49 @@ "node": ">=10" } }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, "node_modules/crelt": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", @@ -5163,6 +5372,34 @@ "node": ">= 8" } }, + "node_modules/crypto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", + "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", + "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, "node_modules/css-declaration-sorter": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz", @@ -5684,6 +5921,16 @@ "node": ">= 0.8" } }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", @@ -5699,6 +5946,23 @@ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", "dev": true }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -5819,12 +6083,14 @@ } }, "node_modules/dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", - "dev": true, + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, "node_modules/dotenv-expand": { @@ -5935,6 +6201,27 @@ "integrity": "sha512-61H9mLzGOCLLVsnLiRzCbc63uldP0AniRYPV3hbGVtONA1pI7qSGILdbofR7A8TMbOypDocEAjH/e+9k1QIe3g==", "dev": true }, + "node_modules/elliptic": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -6693,6 +6980,16 @@ "node": ">=0.8.x" } }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, "node_modules/execa": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", @@ -7413,12 +7710,35 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/hash-sum": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", "dev": true }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -7448,6 +7768,17 @@ "node": "*" } }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -8853,6 +9184,17 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "peer": true }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, "node_modules/mdn-data": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", @@ -8953,6 +9295,25 @@ "node": ">=8.6" } }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -9071,6 +9432,12 @@ "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -9717,6 +10084,12 @@ "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==", "peer": true }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", + "dev": true + }, "node_modules/p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -9802,6 +10175,23 @@ "node": ">=6" } }, + "node_modules/parse-asn1": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "dev": true, + "dependencies": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -9859,6 +10249,12 @@ "tslib": "^2.0.3" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9935,6 +10331,22 @@ "node": ">=8" } }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, "node_modules/pg-connection-string": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.4.tgz", @@ -10841,6 +11253,26 @@ "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -10953,6 +11385,16 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -11264,6 +11706,16 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, "node_modules/rope-sequence": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", @@ -11646,6 +12098,19 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -11951,6 +12416,16 @@ "node": ">= 0.8" } }, + "node_modules/stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dev": true, + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -12636,6 +13111,11 @@ "node": ">= 0.8" } }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, "node_modules/vue": { "version": "3.4.29", "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.29.tgz", diff --git a/package.json b/package.json index 163b0db..551ae97 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,15 @@ "body-parser": "^1.20.2", "core-js": "^3.8.3", "cors": "^2.8.5", + "crypto": "^1.0.1", + "dotenv": "^16.4.5", "express": "^4.19.2", "jsonwebtoken": "^9.0.2", "mysql2": "^3.10.1", "nodemon": "^3.1.3", "sequelize": "^6.37.3", "sequelize-cli": "^6.6.2", + "vm-browserify": "^1.1.2", "vue": "^3.2.13", "vue-multiselect": "^3.0.0", "vue-quill-editor": "^3.0.6", @@ -45,8 +48,13 @@ "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", + "crypto-browserify": "^3.12.0", "eslint": "^7.32.0", - "eslint-plugin-vue": "^8.0.3" + "eslint-plugin-vue": "^8.0.3", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "stream-browserify": "^3.0.0", + "webpack": "^5.92.0" }, "eslintConfig": { "root": true, diff --git a/src/axios.js b/src/axios.js index 45836ab..ea0e885 100644 --- a/src/axios.js +++ b/src/axios.js @@ -2,7 +2,7 @@ import axios from 'axios'; import store from './store'; import router from './router'; -axios.defaults.baseURL = 'http://localhost:3000/api'; +axios.defaults.baseURL = process.env.VUE_APP_BACKEND_URL; axios.interceptors.request.use( config => { diff --git a/src/components/ContactPersonForm.vue b/src/components/ContactPersonForm.vue index 13521e8..8b2477b 100644 --- a/src/components/ContactPersonForm.vue +++ b/src/components/ContactPersonForm.vue @@ -93,9 +93,9 @@ export default { positionIds: positionIds }; if (this.localContactPerson.id) { - await axios.put(`http://localhost:3000/api/contact-persons/${this.localContactPerson.id}`, payload); + await axios.put(`/contact-persons/${this.localContactPerson.id}`, payload); } else { - await axios.post('http://localhost:3000/api/contact-persons', payload); + await axios.post('/contact-persons', payload); } this.$emit('contactPersonSaved'); diff --git a/src/components/EventForm.vue b/src/components/EventForm.vue index 4a692d5..2391dfb 100644 --- a/src/components/EventForm.vue +++ b/src/components/EventForm.vue @@ -175,7 +175,7 @@ export default { }, async created() { try { - const eventTypeResponse = await axios.get('http://localhost:3000/api/event-types'); + const eventTypeResponse = await axios.get('/event-types'); this.eventTypes = eventTypeResponse.data; this.selectedEventType = this.eventTypes.find(type => type.id === this.event.eventTypeId) || null; } catch (error) { @@ -196,9 +196,9 @@ export default { payload.dayOfWeek = payload.dayOfWeek.value; let response; if (this.eventData.id) { - response = await axios.put(`http://localhost:3000/api/events/${this.eventData.id}`, payload); + response = await axios.put(`/events/${this.eventData.id}`, payload); } else { - response = await axios.post('http://localhost:3000/api/events', payload); + response = await axios.post('/events', payload); } this.$emit('saved', response.data); } catch (error) { diff --git a/src/components/InstitutionForm.vue b/src/components/InstitutionForm.vue index cdc3cc6..d3037a4 100644 --- a/src/components/InstitutionForm.vue +++ b/src/components/InstitutionForm.vue @@ -89,9 +89,9 @@ async saveInstitution() { try { if (this.localInstitution.id) { - await axios.put(`http://localhost:3000/api/institutions/${this.localInstitution.id}`, this.localInstitution); + await axios.put(`/institutions/${this.localInstitution.id}`, this.localInstitution); } else { - await axios.post('http://localhost:3000/api/institutions', this.localInstitution); + await axios.post('/institutions', this.localInstitution); } this.$emit('saved'); this.$emit('cancelled'); diff --git a/src/components/PositionSelect.vue b/src/components/PositionSelect.vue index 784726f..c62e812 100644 --- a/src/components/PositionSelect.vue +++ b/src/components/PositionSelect.vue @@ -39,10 +39,8 @@ export default { watch: { value(newVal) { this.selectedPositions = newVal; - console.log('PositionSelect - value watch - newVal:', newVal); }, selectedPositions(newVal) { - console.log('PositionSelect - selectedPositions watch - newVal:', newVal); this.$emit('input', newVal); } }, @@ -52,8 +50,7 @@ export default { methods: { async fetchPositions() { try { - const response = await axios.get('http://localhost:3000/api/positions'); - console.log('PositionSelect - fetchPositions - response.data:', response.data); + const response = await axios.get('/positions'); this.$emit('update:options', response.data); } catch (error) { console.error('Fehler beim Abrufen der Positionen:', error); diff --git a/src/content/admin/AdminMenuManagement.vue b/src/content/admin/AdminMenuManagement.vue index d7ac202..49ea0f5 100644 --- a/src/content/admin/AdminMenuManagement.vue +++ b/src/content/admin/AdminMenuManagement.vue @@ -143,7 +143,7 @@ export default { }, async saveMenuData() { try { - await fetch('http://localhost:3000/api/menu-data', { + await fetch('/menu-data', { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/src/content/admin/ContactPersonManagement.vue b/src/content/admin/ContactPersonManagement.vue index 1669337..f31f252 100644 --- a/src/content/admin/ContactPersonManagement.vue +++ b/src/content/admin/ContactPersonManagement.vue @@ -45,7 +45,7 @@ export default { methods: { async fetchContactPersons() { try { - const response = await axios.get('http://localhost:3000/api/contact-persons'); + const response = await axios.get('/contact-persons'); this.contactPersons = response.data; } catch (error) { console.error('Fehler beim Abrufen der Kontaktpersonen:', error); @@ -53,7 +53,7 @@ export default { }, async fetchPositions() { try { - const response = await axios.get('http://localhost:3000/api/positions'); + const response = await axios.get('/positions'); this.positions = response.data; } catch (error) { console.error('Fehler beim Abrufen der Positionen:', error); diff --git a/src/content/admin/EditPagesComponent.vue b/src/content/admin/EditPagesComponent.vue index 9cfa0cc..f173703 100644 --- a/src/content/admin/EditPagesComponent.vue +++ b/src/content/admin/EditPagesComponent.vue @@ -99,7 +99,7 @@ export default { const fetchPages = async () => { try { - const response = await axios.get('http://localhost:3000/api/menu-data'); + const response = await axios.get('/menu-data'); pages.value = response.data; } catch (error) { console.error('Fehler beim Abrufen der Seiten:', error); diff --git a/src/content/admin/EventManagement.vue b/src/content/admin/EventManagement.vue index 1aa6279..e9c0284 100644 --- a/src/content/admin/EventManagement.vue +++ b/src/content/admin/EventManagement.vue @@ -65,11 +65,11 @@ export default { async fetchData() { try { const [eventResponse, institutionResponse, eventPlaceResponse, contactPersonResponse, eventTypeResponse] = await Promise.all([ - axios.get('http://localhost:3000/api/events'), - axios.get('http://localhost:3000/api/institutions'), - axios.get('http://localhost:3000/api/event-places'), - axios.get('http://localhost:3000/api/contact-persons'), - axios.get('http://localhost:3000/api/event-types') + axios.get('/events'), + axios.get('/institutions'), + axios.get('/event-places'), + axios.get('/contact-persons'), + axios.get('/event-types') ]); this.events = eventResponse.data; @@ -91,7 +91,7 @@ export default { }, async deleteEvent(id) { try { - await axios.delete(`http://localhost:3000/api/events/${id}`); + await axios.delete(`/events/${id}`); this.fetchData(); } catch (error) { console.error('Fehler beim Löschen der Veranstaltung:', error); diff --git a/src/content/admin/EventPlacesManagement.vue b/src/content/admin/EventPlacesManagement.vue index e3dfd1d..592a2e7 100644 --- a/src/content/admin/EventPlacesManagement.vue +++ b/src/content/admin/EventPlacesManagement.vue @@ -55,25 +55,25 @@ export default { }, methods: { async fetchEventPlaces() { - const response = await axios.get('http://localhost:3000/api/event-places'); + const response = await axios.get('/event-places'); this.eventPlaces = response.data; }, async addEventPlace() { if (this.editMode) { - await axios.put(`http://localhost:3000/api/event-places/${this.editId}`, this.newEventPlace); + await axios.put(`/event-places/${this.editId}`, this.newEventPlace); } else { - const response = await axios.post('http://localhost:3000/api/event-places', this.newEventPlace); + const response = await axios.post('/event-places', this.newEventPlace); this.eventPlaces.push(response.data); } this.resetForm(); await this.fetchEventPlaces(); }, async updateEventPlace(eventPlace) { - await axios.put(`http://localhost:3000/api/event-places/${eventPlace.id}`, eventPlace); + await axios.put(`/event-places/${eventPlace.id}`, eventPlace); this.fetchEventPlaces(); // Refresh the list }, async deleteEventPlace(id) { - await axios.delete(`http://localhost:3000/api/event-places/${id}`); + await axios.delete(`/event-places/${id}`); this.fetchEventPlaces(); // Refresh the list }, editEventPlace(eventPlace) { diff --git a/src/content/admin/EventTypesManagement.vue b/src/content/admin/EventTypesManagement.vue index bf95c74..37cc5af 100644 --- a/src/content/admin/EventTypesManagement.vue +++ b/src/content/admin/EventTypesManagement.vue @@ -35,7 +35,7 @@ methods: { async fetchEventTypes() { try { - const response = await axios.get('http://localhost:3000/api/event-types'); + const response = await axios.get('/event-types'); this.eventTypes = response.data; } catch (error) { console.error('Fehler beim Abrufen der Event-Typen:', error); @@ -44,9 +44,9 @@ async saveEventType() { try { if (this.editMode) { - await axios.put(`http://localhost:3000/api/event-types/${this.editId}`, this.eventTypeData); + await axios.put(`/event-types/${this.editId}`, this.eventTypeData); } else { - const response = await axios.post('http://localhost:3000/api/event-types', this.eventTypeData); + const response = await axios.post('/event-types', this.eventTypeData); this.eventTypes.push(response.data); } this.resetForm(); @@ -62,7 +62,7 @@ }, async deleteEventType(id) { try { - await axios.delete(`http://localhost:3000/api/event-types/${id}`); + await axios.delete(`/event-types/${id}`); await this.fetchEventTypes(); } catch (error) { console.error('Fehler beim Löschen des Event-Typs:', error); diff --git a/src/content/admin/InstitutionManagement.vue b/src/content/admin/InstitutionManagement.vue index cf734ad..e5d65dc 100644 --- a/src/content/admin/InstitutionManagement.vue +++ b/src/content/admin/InstitutionManagement.vue @@ -77,7 +77,7 @@ export default { methods: { async fetchInstitutions() { try { - const response = await axios.get('http://localhost:3000/api/institutions'); + const response = await axios.get('/institutions'); this.institutions = response.data; } catch (error) { console.error('Fehler beim Abrufen der Institutionen:', error); @@ -85,7 +85,7 @@ export default { }, async fetchContactPersons() { try { - const response = await axios.get('http://localhost:3000/api/contact-persons'); + const response = await axios.get('/contact-persons'); this.contactPersons = response.data; } catch (error) { console.error('Fehler beim Abrufen der Kontaktpersonen:', error); @@ -94,9 +94,9 @@ export default { async saveInstitution() { try { if (this.editMode) { - await axios.put(`http://localhost:3000/api/institutions/${this.editId}`, this.institutionData); + await axios.put(`/institutions/${this.editId}`, this.institutionData); } else { - const response = await axios.post('http://localhost:3000/api/institutions', this.institutionData); + const response = await axios.post('/institutions', this.institutionData); this.institutions.push(response.data); } this.resetForm(); @@ -113,7 +113,7 @@ export default { }, async deleteInstitution(id) { try { - await axios.delete(`http://localhost:3000/api/institutions/${id}`); + await axios.delete(`/institutions/${id}`); this.fetchInstitutions(); } catch (error) { console.error('Fehler beim Löschen der Institution:', error); diff --git a/src/content/admin/PositionManagement.vue b/src/content/admin/PositionManagement.vue index 7cd2c54..a931ac9 100644 --- a/src/content/admin/PositionManagement.vue +++ b/src/content/admin/PositionManagement.vue @@ -43,25 +43,25 @@ export default { }, methods: { async fetchPositions() { - const response = await axios.get('http://localhost:3000/api/positions'); + const response = await axios.get('/positions'); this.positions = response.data; }, async addPosition() { if (this.editMode) { - await axios.put(`http://localhost:3000/api/positions/${this.editId}`, this.newPosition); + await axios.put(`/positions/${this.editId}`, this.newPosition); } else { - const response = await axios.post('http://localhost:3000/api/positions', this.newPosition); + const response = await axios.post('/positions', this.newPosition); this.positions.push(response.data); } this.resetForm(); await this.fetchPositions(); }, async updatePosition(position) { - await axios.put(`http://localhost:3000/api/positions/${position.id}`, position); + await axios.put(`/positions/${position.id}`, position); this.fetchPositions(); // Refresh the list }, async deletePosition(id) { - await axios.delete(`http://localhost:3000/api/positions/${id}`); + await axios.delete(`/positions/${id}`); this.fetchPositions(); // Refresh the list }, editPosition(position) { diff --git a/src/content/admin/WorshipManagement.vue b/src/content/admin/WorshipManagement.vue index 689afca..370fd7e 100644 --- a/src/content/admin/WorshipManagement.vue +++ b/src/content/admin/WorshipManagement.vue @@ -90,7 +90,7 @@ export default { formatDate, async fetchWorships() { try { - const response = await axios.get('http://localhost:3000/api/worships'); + const response = await axios.get('/worships'); this.worships = response.data; } catch (error) { console.error('Fehler beim Abrufen der Gottesdienste:', error); @@ -98,7 +98,7 @@ export default { }, async fetchEventPlaces() { try { - const response = await axios.get('http://localhost:3000/api/event-places'); + const response = await axios.get('/event-places'); this.eventPlaces = response.data; } catch (error) { console.error('Fehler beim Abrufen der Veranstaltungsorte:', error); @@ -112,9 +112,9 @@ export default { }; if (this.editMode) { - await axios.put(`http://localhost:3000/api/worships/${this.editId}`, payload); + await axios.put(`/worships/${this.editId}`, payload); } else { - await axios.post('http://localhost:3000/api/worships', payload); + await axios.post('/worships', payload); } this.resetForm(); @@ -131,7 +131,7 @@ export default { }, async deleteWorship(id) { try { - await axios.delete(`http://localhost:3000/api/worships/${id}`); + await axios.delete(`/worships/${id}`); await this.fetchWorships(); } catch (error) { console.error('Fehler beim Löschen des Gottesdienstes:', error); diff --git a/src/content/authentication/LoginComponent.vue b/src/content/authentication/LoginComponent.vue index 14bf548..a678b58 100644 --- a/src/content/authentication/LoginComponent.vue +++ b/src/content/authentication/LoginComponent.vue @@ -48,22 +48,15 @@ export default { ...mapActions(['login']), async runLogin() { try { - const response = await axios.post('http://localhost:3000/api/auth/login', { + const response = await axios.post('/auth/login', { email: this.email, password: this.password }); - console.log(1); const token = response.data.token; - console.log(2); const data = response.data; - console.log(3); localStorage.setItem('token', token); - console.log(4); - console.log(data); this.login(data.user); - console.log(5); axios.defaults.headers.common['Authorization'] = `Bearer ${token}`; - console.log(6); this.$router.push('/admin'); } catch (error) { if (error.response) { diff --git a/src/main.js b/src/main.js index 38cef52..b301c72 100644 --- a/src/main.js +++ b/src/main.js @@ -2,16 +2,16 @@ import { createApp } from 'vue'; import AppComponent from './AppComponent.vue'; import router from './router'; import store from './store'; -import axios from './axios'; // Korrigieren Sie den Import-Pfad hier -import './assets/css/editor.css'; // Hier deine CSS-Datei einbinden +import axios from './axios'; +import './assets/css/editor.css'; async function fetchMenuData() { - const response = await fetch('http://localhost:3000/api/menu-data'); - return await response.json(); + const response = await fetch(process.env.VUE_APP_BACKEND_URL + '/menu-data'); + return await response.json(); } fetchMenuData().then(menuData => { - store.commit('setMenuData', menuData); + store.commit('setMenuData', menuData); }); const app = createApp(AppComponent); diff --git a/src/store/index.js b/src/store/index.js index b592a34..40c223e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -19,19 +19,12 @@ export default createStore({ }, mutations: { setLogin(state, { user, token }) { - console.log(1); state.isLoggedIn = true; - console.log(2); state.user = user; - console.log(3); state.token = token; - console.log(4); localStorage.setItem('isLoggedIn', 'true'); - console.log(5); localStorage.setItem('user', JSON.stringify(user)); - console.log(6); localStorage.setItem('token', token); - console.log(7); }, logout(state) { state.isLoggedIn = false; @@ -55,7 +48,7 @@ export default createStore({ actions: { async loadMenuData({ commit }) { try { - const response = await fetch('http://localhost:3000/api/menu-data'); + const response = await fetch('/menu-data'); const menuData = await response.json(); commit('setMenuData', menuData); } catch (error) { @@ -64,7 +57,7 @@ export default createStore({ }, async loadPageContent({ commit }, link) { try { - const response = await axios.get(`http://localhost:3000/api/page-content?link=${link}`); + const response = await axios.get(`/page-content?link=${link}`); commit('SET_PAGE_CONTENT', response.data.content || ''); } catch (error) { console.error('Fehler beim Laden des Seiteninhalts:', error); @@ -74,7 +67,7 @@ export default createStore({ try { const contentToSave = state.pageContent; - await axios.post('http://localhost:3000/api/page-content', { + await axios.post('/page-content', { link, name, content: contentToSave, @@ -86,7 +79,6 @@ export default createStore({ } }, login({ commit }, { user, token }) { - console.log('do login'); commit('setLogin', { user, token }); }, logout({ commit }) { diff --git a/vue.config.js b/vue.config.js index 9db5b67..1a56548 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,9 +1,26 @@ -const { defineConfig } = require('@vue/cli-service') +const { defineConfig } = require('@vue/cli-service'); +const webpack = require('webpack'); module.exports = defineConfig({ transpileDependencies: true, devServer: { host: '127.0.0.1', port: 8080 - } -}) + }, + configureWebpack: { + resolve: { + fallback: { + "path": require.resolve("path-browserify"), + "os": require.resolve("os-browserify/browser"), + "crypto": require.resolve("crypto-browserify"), + "stream": require.resolve("stream-browserify"), + "vm": require.resolve("vm-browserify"), + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': JSON.stringify(process.env) + }), + ], + }, +});