@jant/core 0.3.28 → 0.3.29
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.
- package/bin/reset-password.js +22 -0
- package/dist/index.js +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { randomBytes } from "crypto";
|
|
4
|
+
import { execSync } from "child_process";
|
|
5
|
+
|
|
6
|
+
const isRemote = process.argv.includes("--remote");
|
|
7
|
+
const flag = isRemote ? "--remote" : "--local";
|
|
8
|
+
|
|
9
|
+
const token = randomBytes(32).toString("hex");
|
|
10
|
+
const expiry = Math.floor(Date.now() / 1000) + 15 * 60; // 15 minutes
|
|
11
|
+
const value = `${token}:${expiry}`;
|
|
12
|
+
const timestamp = Math.floor(Date.now() / 1000);
|
|
13
|
+
|
|
14
|
+
const sql = `INSERT OR REPLACE INTO settings (key, value, updated_at) VALUES ('PASSWORD_RESET_TOKEN', '${value}', ${timestamp})`;
|
|
15
|
+
|
|
16
|
+
execSync(`npx wrangler d1 execute DB ${flag} --command "${sql}"`, {
|
|
17
|
+
stdio: "inherit",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
console.log("");
|
|
21
|
+
console.log("Password reset token generated (expires in 15 minutes).");
|
|
22
|
+
console.log(`Visit: /reset?token=${token}`);
|
package/dist/index.js
CHANGED
|
@@ -4692,7 +4692,7 @@ const I18nProvider = ({ c, children })=>{
|
|
|
4692
4692
|
}
|
|
4693
4693
|
|
|
4694
4694
|
const IS_VITE_DEV = typeof __JANT_DEV__ !== "undefined" && __JANT_DEV__ === true;
|
|
4695
|
-
const CORE_VERSION = "0.3.
|
|
4695
|
+
const CORE_VERSION = "0.3.29";
|
|
4696
4696
|
|
|
4697
4697
|
const BaseLayout = ({ title, description, lang, c, toast, faviconUrl, faviconVersion, noindex, isAuthenticated = false, children })=>{
|
|
4698
4698
|
// Read lang from Hono context if available, otherwise use prop or default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jant/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.29",
|
|
4
4
|
"description": "A modern, open-source microblogging platform built on Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
},
|
|
11
11
|
"./i18n": "./src/i18n/index.ts"
|
|
12
12
|
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"jant-reset-password": "bin/reset-password.js"
|
|
15
|
+
},
|
|
13
16
|
"files": [
|
|
17
|
+
"bin",
|
|
14
18
|
"dist",
|
|
15
19
|
"src"
|
|
16
20
|
],
|