lucia
Advanced tools
Comparing version 3.0.0-beta.14 to 3.0.0-beta.15
@@ -42,2 +42,3 @@ import { TimeSpan } from "oslo"; | ||
invalidateUserSessions(userId: string): Promise<void>; | ||
deleteExpiredSessions(): Promise<void>; | ||
readSessionCookie(cookieHeader: string): string | null; | ||
@@ -44,0 +45,0 @@ readBearerToken(authorizationHeader: string): string | null; |
@@ -116,2 +116,5 @@ import { TimeSpan, createDate, isWithinExpirationDate } from "oslo"; | ||
} | ||
async deleteExpiredSessions() { | ||
await this.adapter.deleteExpiredSessions(); | ||
} | ||
readSessionCookie(cookieHeader) { | ||
@@ -118,0 +121,0 @@ const sessionId = this.sessionCookieController.parse(cookieHeader); |
@@ -5,4 +5,6 @@ import { encodeHex, decodeHex } from "oslo/encoding"; | ||
import { alphabet, generateRandomString } from "oslo/random"; | ||
async function generateScryptKey(s, salt, blockSize = 16) { | ||
const keyUint8Array = await scrypt(new TextEncoder().encode(s), new TextEncoder().encode(salt), { | ||
async function generateScryptKey(data, salt, blockSize = 16) { | ||
const encodedData = new TextEncoder().encode(data); | ||
const encodedSalt = new TextEncoder().encode(salt); | ||
const keyUint8Array = await scrypt(encodedData, encodedSalt, { | ||
N: 16384, | ||
@@ -9,0 +11,0 @@ r: blockSize, |
@@ -9,2 +9,3 @@ import type { RegisteredDatabaseSessionAttributes, RegisteredDatabaseUserAttributes } from "./index.js"; | ||
deleteUserSessions(userId: string): Promise<void>; | ||
deleteExpiredSessions(): Promise<void>; | ||
} | ||
@@ -11,0 +12,0 @@ export interface DatabaseUser { |
{ | ||
"name": "lucia", | ||
"version": "3.0.0-beta.14", | ||
"version": "3.0.0-beta.15", | ||
"description": "A simple and flexible authentication library", | ||
@@ -32,3 +32,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"oslo": "^0.27.0" | ||
"oslo": "0.27.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "scripts": { |
37589
473
Updatedoslo@0.27.1