emilsoftware-utilities 1.3.93 → 1.3.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ <!DOCTYPE html>
2
+ <html lang="it">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Reset Password</title>
7
+ </head>
8
+ <body>
9
+ <h1>Reimposta la tua password</h1>
10
+ <form id="resetForm">
11
+ <input type="hidden" id="token" value="">
12
+ <input type="hidden" id="redirectUrl" value="">
13
+ <label for="password">Nuova Password:</label>
14
+ <input type="password" id="password" required>
15
+ <button type="submit">Aggiorna Password</button>
16
+ </form>
17
+ <script>
18
+ document.addEventListener("DOMContentLoaded", function() {
19
+ const urlParams = new URLSearchParams(window.location.search);
20
+ const token = window.location.pathname.split("/").pop();
21
+ const redirectUrl = urlParams.get("redirectUrl") || "/"; // Default: Home
22
+
23
+ document.getElementById("token").value = token;
24
+ document.getElementById("redirectUrl").value = redirectUrl;
25
+
26
+ document.getElementById("resetForm").addEventListener("submit", async function(event) {
27
+ event.preventDefault();
28
+ const password = document.getElementById("password").value;
29
+
30
+ if (!password) {
31
+ alert("Inserisci una nuova password.");
32
+ return;
33
+ }
34
+
35
+ const response = await fetch(`/api/accessi/reset-password/${token}`, {
36
+ method: "POST",
37
+ headers: { "Content-Type": "application/json" },
38
+ body: JSON.stringify({ newPassword: password })
39
+ });
40
+
41
+ const data = await response.json();
42
+ alert(data.message || "Password aggiornata con successo!");
43
+
44
+ if (response.ok) {
45
+ window.location.href = redirectUrl;
46
+ }
47
+ });
48
+ });
49
+ </script>
50
+ </body>
51
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emilsoftware-utilities",
3
- "version": "1.3.93",
3
+ "version": "1.3.94",
4
4
  "description": "Utilities for EmilSoftware",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -8,7 +8,8 @@
8
8
  "scripts": {
9
9
  "release": "standard-version",
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
11
- "build": "tsc",
11
+ "build": "tsc && npm run copy-views",
12
+ "copy-views": "node copy-views.js",
12
13
  "prepublishOnly": "npm run build"
13
14
  },
14
15
  "repository": {
@@ -50,6 +51,7 @@
50
51
  "@types/reflect-metadata": "^0.0.5",
51
52
  "@types/swagger-jsdoc": "^6.0.4",
52
53
  "@types/swagger-ui-express": "^4.1.7",
54
+ "fs-extra": "^11.3.0",
53
55
  "standard-version": "^9.5.0",
54
56
  "typescript": "^5.3.3"
55
57
  },