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

@1auth/messenger

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@1auth/messenger - npm Package Compare versions

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

21

./index.js

@@ -18,2 +18,4 @@ import {

table: 'messengers',
idGenerate: true,
idPrefix: 'messenger',
store: undefined,

@@ -23,3 +25,3 @@ notify: undefined

export default (params) => {
Object.assign(options, { token: outOfBandToken }, params)
Object.assign(options, { id: randomId, token: outOfBandToken }, params)
}

@@ -56,7 +58,6 @@ export const getOptions = () => options

const now = nowInSeconds()
const id = await randomId.create()
const { encryptedKey } = makeSymetricKey(sub)
const encryptedData = encrypt(value, encryptedKey, sub)
await options.store.insert(options.table, {
id,
const params = {
sub,

@@ -69,3 +70,7 @@ type: options.id,

update: now // in case new digests need to be created
})
}
if (options.idGenerate) {
params.id = await options.id.create(options.idPrefix)
}
await options.store.insert(options.table, params)
await createToken(sub, id)

@@ -93,7 +98,3 @@ return id

const token = await options.token.create()
id = await authnCreate(
options.token.type,
{ id, sub, value: token },
options
)
id = await authnCreate(options.token.type, { id, sub, value: token }, options)
await options.notify.trigger('messenger-TYPE-verify', sub, { token })

@@ -100,0 +101,0 @@ return id

@@ -18,2 +18,4 @@ import {

table: 'messengers',
idGenerate: true,
idPrefix: 'messenger',
store: undefined,

@@ -23,3 +25,3 @@ notify: undefined

export default (params) => {
Object.assign(options, { token: outOfBandToken }, params)
Object.assign(options, { id: randomId, token: outOfBandToken }, params)
}

@@ -56,7 +58,6 @@ export const getOptions = () => options

const now = nowInSeconds()
const id = await randomId.create()
const { encryptedKey } = makeSymetricKey(sub)
const encryptedData = encrypt(value, encryptedKey, sub)
await options.store.insert(options.table, {
id,
const params = {
sub,

@@ -69,3 +70,7 @@ type: options.id,

update: now // in case new digests need to be created
})
}
if (options.idGenerate) {
params.id = await options.id.create(options.idPrefix)
}
await options.store.insert(options.table, params)
await createToken(sub, id)

@@ -93,7 +98,3 @@ return id

const token = await options.token.create()
id = await authnCreate(
options.token.type,
{ id, sub, value: token },
options
)
id = await authnCreate(options.token.type, { id, sub, value: token }, options)
await options.notify.trigger('messenger-TYPE-verify', sub, { token })

@@ -100,0 +101,0 @@ return id

{
"name": "@1auth/messenger",
"version": "0.0.0-alpha.17",
"version": "0.0.0-alpha.18",
"description": "",

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

"dependencies": {
"@1auth/authn": "0.0.0-alpha.17",
"@1auth/crypto": "0.0.0-alpha.17"
"@1auth/authn": "0.0.0-alpha.18",
"@1auth/crypto": "0.0.0-alpha.18"
}
}
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