minor changes

This commit is contained in:
Martin Araneda 2023-02-10 22:37:00 -03:00
parent 9d37814bc5
commit bff04407e0
3 changed files with 12 additions and 3 deletions

View File

@ -14,6 +14,7 @@
"axios": "^1.3.2", "axios": "^1.3.2",
"chart.js": "^4.2.0", "chart.js": "^4.2.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"jwt-decode": "^3.1.2",
"pinia": "^2.0.28", "pinia": "^2.0.28",
"primeflex": "^3.3.0", "primeflex": "^3.3.0",
"primeicons": "^6.0.1", "primeicons": "^6.0.1",

View File

@ -4,6 +4,7 @@ import { useLayout } from '@/layout/composables/layout';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useToast } from 'primevue/usetoast'; import { useToast } from 'primevue/usetoast';
import axios from 'axios'; import axios from 'axios';
import jwt_decode from 'jwt-decode';
const { onMenuToggle } = useLayout(); const { onMenuToggle } = useLayout();
@ -58,15 +59,17 @@ async function onClickPasswordChange() {
password: user.value.current_password, password: user.value.current_password,
new_password: user.value.new_password new_password: user.value.new_password
}; };
/* try { var token = localStorage.getItem("token");
const response = await axios.patch(`http://localhost:3001/user/` + user.value.ID, auth.getTokenHeader()); var decoded = jwt_decode(token);
try {
const response = await axios.patch(`http://localhost:3001/user/` + decoded.id, auth.getTokenHeader());
if (response.status !== 204) { if (response.status !== 204) {
console.error(response); console.error(response);
} }
} }
catch (error) { catch (error) {
console.error(error); console.error(error);
} */ }
} }

View File

@ -1120,6 +1120,11 @@ json-stable-stringify-without-jsonify@^1.0.1:
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
jwt-decode@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59"
integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==
levn@^0.4.1: levn@^0.4.1:
version "0.4.1" version "0.4.1"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"