Comparing version 2.7.3 to 2.7.4
# lucia | ||
## 2.7.4 | ||
### Patch changes | ||
- [#1250](https://github.com/lucia-auth/lucia/pull/1250) by [@pilcrowOnPaper](https://github.com/pilcrowOnPaper) : Revert #1158 | ||
- [#1256](https://github.com/lucia-auth/lucia/pull/1256) by [@FredTreg](https://github.com/FredTreg) : Allow debug message to be displayed when request origin not available | ||
- [#1254](https://github.com/lucia-auth/lucia/pull/1254) by [@pilcrowOnPaper](https://github.com/pilcrowOnPaper) : Remove unused `svelte` field from `package.json` | ||
- [#1250](https://github.com/lucia-auth/lucia/pull/1250) by [@pilcrowOnPaper](https://github.com/pilcrowOnPaper) : Remove `nanoid` dependency | ||
## 2.7.3 | ||
@@ -4,0 +16,0 @@ |
@@ -116,4 +116,2 @@ import { debug } from "../utils/debug.js"; | ||
const requestOrigin = request.headers.get("Origin"); | ||
if (!requestOrigin) | ||
return false; | ||
if (!requestOrigin) { | ||
@@ -120,0 +118,0 @@ debug.request.fail("No request origin available"); |
import { LuciaError } from "../auth/error.js"; | ||
import { scryptAsync as scrypt } from "@noble/hashes/scrypt"; | ||
import { customAlphabet } from "nanoid"; | ||
export const generateRandomString = (length, alphabet) => { | ||
const DEFAULT_ALPHABET = "abcdefghijklmnopqrstuvwxyz1234567890"; | ||
const customNanoid = customAlphabet(alphabet ?? DEFAULT_ALPHABET); | ||
return customNanoid(length); | ||
import { scrypt } from "../scrypt/index.js"; | ||
const DEFAULT_ALPHABET = "abcdefghijklmnopqrstuvwxyz1234567890"; | ||
export const generateRandomString = (length, alphabet = DEFAULT_ALPHABET) => { | ||
const randomUint32Values = new Uint32Array(length); | ||
crypto.getRandomValues(randomUint32Values); | ||
const u32Max = 0xffffffff; | ||
let result = ""; | ||
for (let i = 0; i < randomUint32Values.length; i++) { | ||
const rand = randomUint32Values[i] / (u32Max + 1); | ||
result += alphabet[Math.floor(alphabet.length * rand)]; | ||
} | ||
return result; | ||
}; | ||
@@ -9,0 +15,0 @@ export const generateScryptHash = async (s) => { |
{ | ||
"name": "lucia", | ||
"version": "2.7.3", | ||
"version": "2.7.4", | ||
"description": "A simple and flexible authentication library", | ||
@@ -8,3 +8,2 @@ "main": "dist/index.js", | ||
"module": "dist/index.js", | ||
"svelte": "dist/index.js", | ||
"type": "module", | ||
@@ -52,6 +51,2 @@ "files": [ | ||
}, | ||
"dependencies": { | ||
"@noble/hashes": "1.3.2", | ||
"nanoid": "5.0.1" | ||
}, | ||
"scripts": { | ||
@@ -58,0 +53,0 @@ "build": "shx rm -rf ./dist/* && tsc", |
94373
0
44
1995
- Removed@noble/hashes@1.3.2
- Removednanoid@5.0.1
- Removed@noble/hashes@1.3.2(transitive)
- Removednanoid@5.0.1(transitive)