@1auth/authn
Advanced tools
Comparing version
18
index.js
@@ -93,3 +93,3 @@ import { setTimeout } from 'node:timers/promises' | ||
export const create = async ( | ||
const createCredential = async ( | ||
credentialOptions, | ||
@@ -129,6 +129,20 @@ sub, | ||
} | ||
return params | ||
} | ||
export const create = async (credentialOptions, sub, values) => { | ||
const params = await createCredential(credentialOptions, sub, values) | ||
const row = await options.store.insert(options.table, params) | ||
return { type, id: row.id, value, otp, expire } | ||
return { ...params, id: row.id } | ||
} | ||
export const createList = async (credentialOptions, sub, list) => { | ||
const rows = await Promise.all( | ||
list.map((values) => createCredential(credentialOptions, sub, values)) | ||
) | ||
const params = rows[0] | ||
const res = await options.store.insertList(options.table, rows) | ||
return { ...params, id: res } | ||
} | ||
export const update = async ( | ||
@@ -135,0 +149,0 @@ credentialOptions, |
{ | ||
"name": "@1auth/authn", | ||
"version": "0.0.0-alpha.51", | ||
"version": "0.0.0-alpha.52", | ||
"description": "", | ||
@@ -53,4 +53,4 @@ "type": "module", | ||
"dependencies": { | ||
"@1auth/crypto": "0.0.0-alpha.51" | ||
"@1auth/crypto": "0.0.0-alpha.52" | ||
} | ||
} |
10357
4.56%335
3.72%+ Added
- Removed
Updated