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

@accounts/password

Package Overview
Dependencies
Maintainers
6
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accounts/password - npm Package Compare versions

Comparing version 0.26.0-alpha.2 to 0.26.0-alpha.3

10

lib/accounts-password.d.ts

@@ -92,3 +92,3 @@ import { User, TokenRecord, DatabaseInterface, AuthenticationService, ConnectionInformations, LoginResult, CreateUserServicePassword, LoginUserPasswordService } from '@accounts/types';

}
export default class AccountsPassword implements AuthenticationService {
export default class AccountsPassword<CustomUser extends User = User> implements AuthenticationService {
serviceName: string;

@@ -100,4 +100,4 @@ server: AccountsServer;

constructor(options?: AccountsPasswordOptions);
setStore(store: DatabaseInterface): void;
authenticate(params: LoginUserPasswordService): Promise<User>;
setStore(store: DatabaseInterface<CustomUser>): void;
authenticate(params: LoginUserPasswordService): Promise<CustomUser>;
/**

@@ -108,3 +108,3 @@ * @description Find a user by one of his emails.

*/
findUserByEmail(email: string): Promise<User | null>;
findUserByEmail(email: string): Promise<CustomUser | null>;
/**

@@ -115,3 +115,3 @@ * @description Find a user by his username.

*/
findUserByUsername(username: string): Promise<User | null>;
findUserByUsername(username: string): Promise<CustomUser | null>;
/**

@@ -118,0 +118,0 @@ * @description Add an email address for a user.

{
"name": "@accounts/password",
"version": "0.26.0-alpha.2",
"version": "0.26.0-alpha.3",
"license": "MIT",

@@ -21,3 +21,3 @@ "main": "lib/index.js",

"dependencies": {
"@accounts/two-factor": "^0.26.0-alpha.2",
"@accounts/two-factor": "^0.26.0-alpha.3",
"bcryptjs": "^2.4.3",

@@ -28,4 +28,4 @@ "lodash": "^4.17.15",

"devDependencies": {
"@accounts/server": "^0.26.0-alpha.2",
"@accounts/types": "^0.26.0-alpha.2",
"@accounts/server": "^0.26.0-alpha.3",
"@accounts/types": "^0.26.0-alpha.3",
"@types/bcryptjs": "2.4.2",

@@ -41,3 +41,3 @@ "@types/jest": "25.1.4",

},
"gitHead": "ad0914817551b832a11600613981ae5dba11c09d"
"gitHead": "c117b8980f2153d497be744f1280bb2db2470514"
}

@@ -162,3 +162,4 @@ import { trim, isEmpty, pick, isString, isPlainObject, find, includes, defer } from 'lodash';

export default class AccountsPassword implements AuthenticationService {
export default class AccountsPassword<CustomUser extends User = User>
implements AuthenticationService {
public serviceName = 'password';

@@ -168,3 +169,3 @@ public server!: AccountsServer;

private options: AccountsPasswordOptions & typeof defaultOptions;
private db!: DatabaseInterface;
private db!: DatabaseInterface<CustomUser>;

@@ -176,3 +177,3 @@ constructor(options: AccountsPasswordOptions = {}) {

public setStore(store: DatabaseInterface) {
public setStore(store: DatabaseInterface<CustomUser>) {
this.db = store;

@@ -182,3 +183,3 @@ this.twoFactor.setStore(store);

public async authenticate(params: LoginUserPasswordService): Promise<User> {
public async authenticate(params: LoginUserPasswordService): Promise<CustomUser> {
const { user, password, code } = params;

@@ -210,3 +211,3 @@ if (!user || !password) {

*/
public findUserByEmail(email: string): Promise<User | null> {
public findUserByEmail(email: string): Promise<CustomUser | null> {
return this.db.findUserByEmail(email);

@@ -220,3 +221,3 @@ }

*/
public findUserByUsername(username: string): Promise<User | null> {
public findUserByUsername(username: string): Promise<CustomUser | null> {
return this.db.findUserByUsername(username);

@@ -675,3 +676,3 @@ }

password: string
): Promise<User> {
): Promise<CustomUser> {
const { username, email, id } = isString(user)

@@ -681,3 +682,3 @@ ? this.toUsernameAndEmail({ user })

let foundUser: User | null = null;
let foundUser: CustomUser | null = null;

@@ -684,0 +685,0 @@ if (id) {

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