Skip to content

Commit ae49525

Browse files
committed
security fix: replace shortid with nanoid
1 parent c0981c2 commit ae49525

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed

package-lock.json

Lines changed: 13 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"lowdb": "^3.0.0",
3636
"luxon": "^2.0.2",
3737
"macos-focus-mode": "^1.0.0",
38+
"nanoid": "^3.3.1",
3839
"semver": "^7.3.4",
39-
"shortid": "^2.2.16",
4040
"yargs": "^17.2.1"
4141
}
4242
}

src/db/session.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import shortId from "shortid";
1+
import {nanoid} from "nanoid";
22
import {DatabaseCollection} from "./collection.js";
33

44
export class TimerSession extends DatabaseCollection {
55
static collection = "sessions";
66
static create(sessionData) {
7-
const sessionId = shortId.generate();
7+
const sessionId = nanoid(8);
88

99
const session = new TimerSession(sessionId);
1010
session.create(sessionData);

0 commit comments

Comments
 (0)