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

@accounts/two-factor

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accounts/two-factor - npm Package Compare versions

Comparing version 0.32.4 to 1.0.0-alpha-20231022085748-0910b9e1

6

lib/two-factor.d.ts
import { GeneratedSecret } from '@levminer/speakeasy';
import { User, DatabaseInterface } from '@accounts/types';
import { User, DatabaseInterfaceUser } from '@accounts/types';
import { AccountsTwoFactorOptions } from './types';
export declare class TwoFactor {
export declare class TwoFactor<CustomUser extends User = User> {
private options;

@@ -13,3 +13,3 @@ private db;

*/
setStore(store: DatabaseInterface): void;
setUserStore(store: DatabaseInterfaceUser<CustomUser>): void;
/**

@@ -16,0 +16,0 @@ * Authenticate a user with a 2fa code

@@ -13,6 +13,2 @@ "use strict";

class TwoFactor {
constructor(options = {}) {
this.serviceName = 'two-factor';
this.options = { ...defaultOptions, ...options };
}
verifyTOTPCode(secret, code) {

@@ -34,6 +30,10 @@ try {

}
constructor(options = {}) {
this.serviceName = 'two-factor';
this.options = { ...defaultOptions, ...options };
}
/**
* Set two factor store
*/
setStore(store) {
setUserStore(store) {
this.db = store;

@@ -40,0 +40,0 @@ }

{
"name": "@accounts/two-factor",
"version": "0.32.4",
"version": "1.0.0-alpha-20231022085748-0910b9e1",
"license": "MIT",

@@ -10,2 +10,12 @@ "main": "lib/index.js",

},
"scripts": {
"clean": "yarn run -T rimraf lib",
"start": "yarn run -T tsc --watch",
"precompile": "yarn run clean",
"compile": "yarn run -T tsc",
"prepublishOnly": "yarn run compile",
"test": "yarn run test",
"testonly": "yarn run -T jest",
"coverage": "yarn run -T jest --coverage"
},
"files": [

@@ -20,23 +30,6 @@ "src",

"dependencies": {
"@accounts/types": "^0.33.2",
"@levminer/speakeasy": "1.3.3",
"tslib": "2.3.1"
},
"devDependencies": {
"@types/jest": "27.0.2",
"@types/node": "16.11.7",
"jest": "27.3.1",
"rimraf": "3.0.2",
"ts-jest": "27.0.7"
},
"scripts": {
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "pnpm run clean",
"compile": "tsc",
"test": "npm run test",
"testonly": "jest --coverage",
"coverage": "jest --coverage"
},
"readme": "# @accounts/two-factor\n\n[![npm](https://img.shields.io/npm/v/@accounts/two-factor.svg)](https://www.npmjs.com/package/@accounts/two-factor)\n![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)\n"
}
"@accounts/types": "1.0.0-alpha-20231022085748-0910b9e1",
"@levminer/speakeasy": "1.4.2",
"tslib": "2.6.2"
}
}
import { GeneratedSecret, generateSecret, totp } from '@levminer/speakeasy';
import { User, DatabaseInterface } from '@accounts/types';
import { User, DatabaseInterfaceUser } from '@accounts/types';
import { errors } from './errors';

@@ -13,5 +13,5 @@ import { AccountsTwoFactorOptions } from './types';

export class TwoFactor {
export class TwoFactor<CustomUser extends User = User> {
private options: AccountsTwoFactorOptions & typeof defaultOptions;
private db!: DatabaseInterface;
private db!: DatabaseInterfaceUser<CustomUser>;
private serviceName = 'two-factor';

@@ -41,3 +41,3 @@

*/
public setStore(store: DatabaseInterface): void {
public setUserStore(store: DatabaseInterfaceUser<CustomUser>): void {
this.db = store;

@@ -44,0 +44,0 @@ }

Sorry, the diff of this file is not supported yet

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