From dcb423d913f8a63fa57c85f5856f9bb2c92da8e8 Mon Sep 17 00:00:00 2001 From: Raquel Roman-Rodriguez Date: Fri, 6 Dec 2024 12:27:26 -0500 Subject: [PATCH] fix devise JWT --- .gitignore | 3 + config/application.rb | 3 + config/credentials.yml.enc | 1 - config/credentials.yml.enc.bak | 1 - config/initializers/devise.rb | 3 +- config/master.key.bak | 1 - frontend/node_modules/.package-lock.json | 61 ++------------ .../node_modules/.vite/deps/_metadata.json | 79 ------------------- 8 files changed, 15 insertions(+), 137 deletions(-) delete mode 100644 config/credentials.yml.enc delete mode 100644 config/credentials.yml.enc.bak delete mode 100644 config/master.key.bak delete mode 100644 frontend/node_modules/.vite/deps/_metadata.json diff --git a/.gitignore b/.gitignore index fa0b48bb..2f49c83d 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ # Ignore master key for decrypting credentials and more. /config/master.key +/config/master.key.bak +/config/credentials.yml.enc.bak + # Ignore node modules node_modules diff --git a/config/application.rb b/config/application.rb index b42376e7..6c2f9e0d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -27,6 +27,9 @@ class Application < Rails::Application # Only loads a smaller set of middleware suitable for API only apps. # Middleware like session, flash, cookies can be added back manually. # Skip views, helpers and assets when generating a new resource. + config.middleware.use ActionDispatch::Cookies + config.middleware.use ActionDispatch::Session::CookieStore + config.api_only = true end end diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc deleted file mode 100644 index b5f4c599..00000000 --- a/config/credentials.yml.enc +++ /dev/null @@ -1 +0,0 @@ -ESCVf8zXQyPqZFB5il4rUzeZ1sh/MRK9qqF+am7OCTyof67Yl9a1srT2a3nIibhVm4rd2VFEcYYMF3NjEWTqTSkL4QOyG7LruUJTGeoGFXOKjq7Jt5Sy0IfJJpCFYdUPdDfdj6uQ0eGa0b6uvN0leG5u8nCY3SJrOtRjb6BGZxzpXyY0jOZw6X/bBZ5XKCI9M5R5AkBFRjNon1ADJiJ//a2WF3M81HA9xRueox08jqWViP9TwqmbsRw3zQ8NkgjIq9h9Qkk0Ysi5q2SQD7nOLwKDgExR00FP5nYMPCPhdlsGZs9bmTjQIQRKtsyw6qg+Sj1IZZyJHSFKhHovYx/o1UTcxBf3pU1pXOQK1qOIlLTlAJNo7SMO9SdN/ByV14TilPIYiLMHG5RMWNqRFlGMY1xUmQ2o--5R2uur4GHA/tmBsG--BbLAw+261PEX8H6iwLRQ4g== \ No newline at end of file diff --git a/config/credentials.yml.enc.bak b/config/credentials.yml.enc.bak deleted file mode 100644 index 1693592d..00000000 --- a/config/credentials.yml.enc.bak +++ /dev/null @@ -1 +0,0 @@ -lb3sm1G2uY1hyRbmz1v+gB16QKPzLMoVLVEUgEDuGVNtQVWu3h3PND2FpMi2xza+ffh5FhR2Awv5f9w5Ke1nAubo+PAaXV8XNebRM9Gi65/lNHGKfaBn6WvZwZn/rJPynp05mlU/+QsGLTZjJ1Ed+1rE/C6bYZ3qdKmiqHTXrmA0pTS4H3k5PAaJUkWZL9Yq0TKyo/v1iHQQtxDsqyxsNjXZZpFWcvmUPHLxNXY/iZqFP2+ApP1ot+2isL5VO5rHbaeJODXmhg1NvbO73UJRECok/EIKiaIKMQPM7PEJ4Q6cXOYnsHbamyszcdDlzeM8+7uWSONk0SUHbMvp7o6iqQ1hXEtRYPW7kpuwE7IUjbe2vstOHQ/ADvHwMEiQyTPAWGJroGesmJaMx065FI2a7isssMKv--JLpaTvFQzsCEDEYh--0AmLOnu/mo4CfzKtkig9yQ== \ No newline at end of file diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 143225fd..86b191fa 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -308,8 +308,7 @@ # ==> Configuration for :registerable - jwt_secret = ENV["DEVISE_JWT_SECRET_KEY"] || SecureRandom.hex(20) unless Rails.env.production? - jwt_secret ||= Rails.application.credentials.fetch(:secret_key_base) + jwt_secret = ENV.fetch("DEVISE_JWT_SECRET_KEY") { "713135daf69a905f3b1e3758ac144401c78a5c66553c845871998f1386c5b48869b043c3e50e45b63acba54daf1005004f9a38b7bdd6d6aa5e11181940b2564d" } # When set to false, does not sign a user in automatically after their password is # changed. Defaults to true, so a user is signed in automatically after changing a password. diff --git a/config/master.key.bak b/config/master.key.bak deleted file mode 100644 index 00e276de..00000000 --- a/config/master.key.bak +++ /dev/null @@ -1 +0,0 @@ -9682574f0b7086363f4e838d4509b74d \ No newline at end of file diff --git a/frontend/node_modules/.package-lock.json b/frontend/node_modules/.package-lock.json index 0e8f643a..d67a6746 100644 --- a/frontend/node_modules/.package-lock.json +++ b/frontend/node_modules/.package-lock.json @@ -342,12 +342,12 @@ "node": ">=6.9.0" } }, - "node_modules/@esbuild/darwin-x64": { + "node_modules/@esbuild/darwin-arm64": { "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, "license": "MIT", @@ -359,23 +359,6 @@ "node": ">=12" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -701,12 +684,12 @@ "react": ">=16.14.0" } }, - "node_modules/@rollup/rollup-darwin-x64": { + "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.22.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.5.tgz", - "integrity": "sha512-D8brJEFg5D+QxFcW6jYANu+Rr9SlKtTenmsX5hOSzNYVrK5oLAEMTUgKWYJP+wdKyCdeSwnapLsn+OVRFycuQg==", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.5.tgz", + "integrity": "sha512-250ZGg4ipTL0TGvLlfACkIxS9+KLtIbn7BCZjsZj88zSg2Lvu3Xdw6dhAhfe/FjjXPVNCtcSp+WZjVsD3a/Zlw==", "cpu": [ - "x64" + "arm64" ], "dev": true, "license": "MIT", @@ -715,34 +698,6 @@ "darwin" ] }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.22.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.5.tgz", - "integrity": "sha512-N0jPPhHjGShcB9/XXZQWuWBKZQnC1F36Ce3sDqWpujsGjDz/CQtOL9LgTrJ+rJC8MJeesMWrMWVLKKNR/tMOCA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.22.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.5.tgz", - "integrity": "sha512-uBa2e28ohzNNwjr6Uxm4XyaA1M/8aTgfF2T7UIlElLaeXkgpmIJ2EitVNQxjO9xLLLy60YqAgKn/AqSpCUkE9g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, "node_modules/@swc/helpers": { "version": "0.5.13", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.13.tgz", diff --git a/frontend/node_modules/.vite/deps/_metadata.json b/frontend/node_modules/.vite/deps/_metadata.json deleted file mode 100644 index 4a56e894..00000000 --- a/frontend/node_modules/.vite/deps/_metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "hash": "18145999", - "configHash": "6b939941", - "lockfileHash": "00d88907", - "browserHash": "b7be59bb", - "optimized": { - "react": { - "src": "../../react/index.js", - "file": "react.js", - "fileHash": "71e923de", - "needsInterop": true - }, - "react/jsx-dev-runtime": { - "src": "../../react/jsx-dev-runtime.js", - "file": "react_jsx-dev-runtime.js", - "fileHash": "8b2dad7f", - "needsInterop": true - }, - "react/jsx-runtime": { - "src": "../../react/jsx-runtime.js", - "file": "react_jsx-runtime.js", - "fileHash": "1deb61e7", - "needsInterop": true - }, - "chart.js": { - "src": "../../chart.js/dist/chart.js", - "file": "chart__js.js", - "fileHash": "555b01d9", - "needsInterop": false - }, - "jwt-decode": { - "src": "../../jwt-decode/build/esm/index.js", - "file": "jwt-decode.js", - "fileHash": "97801df4", - "needsInterop": false - }, - "react-bootstrap": { - "src": "../../react-bootstrap/esm/index.js", - "file": "react-bootstrap.js", - "fileHash": "de6d81da", - "needsInterop": false - }, - "react-chartjs-2": { - "src": "../../react-chartjs-2/dist/index.js", - "file": "react-chartjs-2.js", - "fileHash": "d95bc56c", - "needsInterop": false - }, - "react-dom/client": { - "src": "../../react-dom/client.js", - "file": "react-dom_client.js", - "fileHash": "c1f3b203", - "needsInterop": true - }, - "react-router-dom": { - "src": "../../react-router-dom/dist/index.js", - "file": "react-router-dom.js", - "fileHash": "60f6baa0", - "needsInterop": false - } - }, - "chunks": { - "chunk-XFWV2CGB": { - "file": "chunk-XFWV2CGB.js" - }, - "chunk-6BXS7Q2T": { - "file": "chunk-6BXS7Q2T.js" - }, - "chunk-PBXWVHXV": { - "file": "chunk-PBXWVHXV.js" - }, - "chunk-4HAMFFQC": { - "file": "chunk-4HAMFFQC.js" - }, - "chunk-EQCVQC35": { - "file": "chunk-EQCVQC35.js" - } - } -} \ No newline at end of file