Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@1auth/authn

Package Overview
Dependencies
Maintainers
0
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@1auth/authn - npm Package Compare versions

Comparing version 0.0.0-alpha.45 to 0.0.0-alpha.46

27

index.js

@@ -63,3 +63,3 @@ import { setTimeout } from 'node:timers/promises'

const type = makeType(credentialOptions)
const credentials = await options.store.selectList(
const items = await options.store.selectList(
options.table,

@@ -75,4 +75,4 @@ {

const list = []
for (let i = credentials.length; i--;) {
const credential = credentials[i]
for (let i = items.length; i--;) {
const item = items[i]
// TODO need filter for expire

@@ -82,10 +82,10 @@ // if (credential.expire < now) {

// }
const { encryptionKey: encryptedKey } = credential
delete credential.encryptionKey
const decryptedCredential = symmetricDecryptFields(
credential,
const { encryptionKey: encryptedKey } = item
delete item.encryptionKey
const decryptedItem = symmetricDecryptFields(
item,
{ encryptedKey, sub },
options.encryptedFields
)
list.push(decryptedCredential)
list.push(decryptedItem)
}

@@ -182,2 +182,3 @@ return list

)
const now = nowInSeconds()
let valid

@@ -201,3 +202,7 @@ for (const credential of credentials) {

if (otp) {
await options.store.remove(options.table, { id, sub })
await options.store.update(
options.table,
{ id, sub },
{ update: now, expire: now, lastused: now }
)
} else if (credentialOptions.clean) {

@@ -219,3 +224,5 @@ await credentialOptions.clean(sub, value, values)

await timeout
if (!valid) throw new Error('401 Unauthorized')
if (!valid) {
throw new Error('401 Unauthorized')
}
return sub

@@ -222,0 +229,0 @@ }

{
"name": "@1auth/authn",
"version": "0.0.0-alpha.45",
"version": "0.0.0-alpha.46",
"description": "",

@@ -53,4 +53,4 @@ "type": "module",

"dependencies": {
"@1auth/crypto": "0.0.0-alpha.45"
"@1auth/crypto": "0.0.0-alpha.46"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc