nodecommons-security
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -6,5 +6,5 @@ import { ICommonsSession } from 'tscommons-session'; | ||
private pepper?; | ||
constructor(pepper?: string | undefined, allowMultipleSessionsForSameUser?: boolean, isEqualSubCheck?: (a: T, b: T) => boolean); | ||
constructor(pepper?: string | undefined, allowMultipleSessionsForSameUser?: boolean); | ||
generatePwHash(pw: string, salt: string): string; | ||
authenticateWithPwHash(user: T, pw: string): ICommonsSession<T> | undefined; | ||
} |
@@ -6,4 +6,4 @@ "use strict"; | ||
class CommonsUserPwHashSessionService extends commons_user_session_service_1.CommonsUserSessionService { | ||
constructor(pepper, allowMultipleSessionsForSameUser = false, isEqualSubCheck) { | ||
super(allowMultipleSessionsForSameUser, isEqualSubCheck); | ||
constructor(pepper, allowMultipleSessionsForSameUser = false) { | ||
super(allowMultipleSessionsForSameUser); | ||
this.pepper = pepper; | ||
@@ -10,0 +10,0 @@ } |
@@ -5,4 +5,3 @@ import { ICommonsSession } from 'tscommons-session'; | ||
export declare abstract class CommonsUserSessionService<T extends ICommonsUser> extends CommonsSessionService<T> { | ||
private isEqualSubCheck?; | ||
constructor(allowMultipleSessionsForSameUser?: boolean, isEqualSubCheck?: ((a: T, b: T) => boolean) | undefined); | ||
constructor(allowMultipleSessionsForSameUser?: boolean); | ||
protected isEqual(a: T, b: T): boolean; | ||
@@ -9,0 +8,0 @@ protected isStillValid(user: T): Promise<boolean>; |
@@ -14,5 +14,4 @@ "use strict"; | ||
class CommonsUserSessionService extends commons_session_service_1.CommonsSessionService { | ||
constructor(allowMultipleSessionsForSameUser = false, isEqualSubCheck) { | ||
constructor(allowMultipleSessionsForSameUser = false) { | ||
super(allowMultipleSessionsForSameUser); | ||
this.isEqualSubCheck = isEqualSubCheck; | ||
} | ||
@@ -22,4 +21,2 @@ isEqual(a, b) { | ||
return false; | ||
if (this.isEqualSubCheck && !this.isEqualSubCheck(a, b)) | ||
return false; | ||
return true; | ||
@@ -26,0 +23,0 @@ } |
{ | ||
"name": "nodecommons-security", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16854
259