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

@1auth/authn-access-token

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@1auth/authn-access-token - npm Package Compare versions

Comparing version 0.0.0-alpha.18 to 0.0.0-alpha.19

14

./index.js

@@ -18,7 +18,7 @@ import { accessToken, createDigest } from '@1auth/crypto'

export const exists = async (secret) => {
return options.store.exists(options.table, {
id: await __id(secret)
})
const digest = await createDigest(secret)
return options.store.exists(options.table, { digest })
}
// authenticate(accessToken, accessToken)
export const authenticate = async (username, secret) => {

@@ -31,7 +31,7 @@ const { sub } = await authnVerifyAuthentication(username, secret, options)

const secret = options.prefix + '-' + (await options.secret.create())
const id = await __id(secret)
const now = nowInSeconds()
const digest = await createDigest(secret)
await authnCreate(
options.secret.type,
{ id, sub, name, value: secret, verify: now, expire: now + expire },
{ sub, name, value: secret, digest, verify: now, expire: now + expire },
options

@@ -55,6 +55,2 @@ )

const __id = async (secret) => {
return createDigest(secret).then((digest) => digest.split(':')[1])
}
const nowInSeconds = () => Math.floor(Date.now() / 1000)

@@ -18,7 +18,7 @@ import { accessToken, createDigest } from '@1auth/crypto'

export const exists = async (secret) => {
return options.store.exists(options.table, {
id: await __id(secret)
})
const digest = await createDigest(secret)
return options.store.exists(options.table, { digest })
}
// authenticate(accessToken, accessToken)
export const authenticate = async (username, secret) => {

@@ -31,7 +31,7 @@ const { sub } = await authnVerifyAuthentication(username, secret, options)

const secret = options.prefix + '-' + (await options.secret.create())
const id = await __id(secret)
const now = nowInSeconds()
const digest = await createDigest(secret)
await authnCreate(
options.secret.type,
{ id, sub, name, value: secret, verify: now, expire: now + expire },
{ sub, name, value: secret, digest, verify: now, expire: now + expire },
options

@@ -55,6 +55,2 @@ )

const __id = async (secret) => {
return createDigest(secret).then((digest) => digest.split(':')[1])
}
const nowInSeconds = () => Math.floor(Date.now() / 1000)
{
"name": "@1auth/authn-access-token",
"version": "0.0.0-alpha.18",
"version": "0.0.0-alpha.19",
"description": "",

@@ -51,7 +51,7 @@ "type": "module",

"homepage": "https://github.com/willfarrell/1auth",
"gitHead": "bc6f992eee0f1c02ccd29e050bb8179f546aef87",
"gitHead": "64ff0102cc1360d4b208360a074fd25483fb8b79",
"dependencies": {
"@1auth/authn": "0.0.0-alpha.18",
"@1auth/crypto": "0.0.0-alpha.18"
"@1auth/authn": "0.0.0-alpha.19",
"@1auth/crypto": "0.0.0-alpha.19"
}
}
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