@tozielinski/next-upstash-nonce 1.1.4 → 1.1.5

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.1.4"
2
+ ".": "1.1.5"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.5](https://github.com/tozielinski/next-upstash-nonce/compare/v1.1.4...v1.1.5) (2025-11-21)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * npm publish error ([fbcfc50](https://github.com/tozielinski/next-upstash-nonce/commit/fbcfc50f73a1a193b9ef38ea3618f373995d7b53))
9
+
3
10
  ## [1.1.4](https://github.com/tozielinski/next-upstash-nonce/compare/v1.1.3...v1.1.4) (2025-11-21)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tozielinski/next-upstash-nonce",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Create, store, verify and delete nonces in Redis by Upstash for Next.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.js CHANGED
@@ -1,12 +1,8 @@
1
1
  'use server';
2
2
  "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
3
  Object.defineProperty(exports, "__esModule", { value: true });
7
4
  exports.NonceManager = void 0;
8
- // import {v4 as uuid} from "uuid";
9
- const crypto_1 = __importDefault(require("crypto"));
5
+ const uuid_1 = require("uuid");
10
6
  class NonceManager {
11
7
  redis;
12
8
  length;
@@ -24,9 +20,9 @@ class NonceManager {
24
20
  * and returns the nonce string.
25
21
  */
26
22
  async create() {
27
- const buffer = crypto_1.default.randomBytes(this.length);
28
- const nonce = buffer.toString("hex");
29
- // const nonce = uuid();
23
+ // const buffer = crypto.randomBytes(this.length);
24
+ // const nonce = buffer.toString("hex");
25
+ const nonce = (0, uuid_1.v4)();
30
26
  const key = this.prefix + nonce;
31
27
  // console.log("creating nonce:", nonce);
32
28
  // set with ttl (nx not required — collisions extremely unlikely)
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  'use server'
2
2
 
3
3
  import { Redis } from "@upstash/redis";
4
- // import {v4 as uuid} from "uuid";
5
- import crypto from "crypto";
4
+ import {v4 as uuid} from "uuid";
5
+ // import crypto from "crypto";
6
6
 
7
7
  export type NonceOptions = {
8
8
  length?: number; // bytes
@@ -31,9 +31,9 @@ export class NonceManager {
31
31
  * and returns the nonce string.
32
32
  */
33
33
  async create(): Promise<string> {
34
- const buffer = crypto.randomBytes(this.length);
35
- const nonce = buffer.toString("hex");
36
- // const nonce = uuid();
34
+ // const buffer = crypto.randomBytes(this.length);
35
+ // const nonce = buffer.toString("hex");
36
+ const nonce = uuid();
37
37
  const key = this.prefix + nonce;
38
38
 
39
39
  // console.log("creating nonce:", nonce);