From 618ee7f9074a9d02caeed23c060f279a4fa004a1 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Tue, 29 Nov 2016 19:45:35 +0100 Subject: [PATCH] use immutable password --- src/domain/password.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/domain/password.js b/src/domain/password.js index 4b766d0..0f2f2fa 100644 --- a/src/domain/password.js +++ b/src/domain/password.js @@ -1,6 +1,6 @@ export default class Password { - constructor(password) { - this.password = password; + constructor(pwd) { + let password = Object.assign({}, pwd); this.options = { uppercase: password.uppercase, lowercase: password.lowercase, @@ -8,7 +8,8 @@ export default class Password { symbols: password.symbols, length: password.length, counter: password.counter, - } + }; + this.password = password; } isNewPassword(passwords) {