Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -14,15 +14,12 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import zxcvbn, { ZXCVBNFeedbackWarning } from 'zxcvbn';
|
||||
import zxcvbn, { ZXCVBNFeedbackWarning } from "zxcvbn";
|
||||
|
||||
import { MatrixClientPeg } from '../MatrixClientPeg';
|
||||
import { _t, _td } from '../languageHandler';
|
||||
import { MatrixClientPeg } from "../MatrixClientPeg";
|
||||
import { _t, _td } from "../languageHandler";
|
||||
|
||||
const ZXCVBN_USER_INPUTS = [
|
||||
'riot',
|
||||
'matrix',
|
||||
];
|
||||
const ZXCVBN_USER_INPUTS = ["riot", "matrix"];
|
||||
|
||||
// Translations for zxcvbn's suggestion strings
|
||||
_td("Use a few words, avoid common phrases");
|
||||
|
@ -40,8 +37,8 @@ _td("Predictable substitutions like '@' instead of 'a' don't help very much");
|
|||
_td("Add another word or two. Uncommon words are better.");
|
||||
|
||||
// and warnings
|
||||
_td("Repeats like \"aaa\" are easy to guess");
|
||||
_td("Repeats like \"abcabcabc\" are only slightly harder to guess than \"abc\"");
|
||||
_td('Repeats like "aaa" are easy to guess');
|
||||
_td('Repeats like "abcabcabc" are only slightly harder to guess than "abc"');
|
||||
_td("Sequences like abc or 6543 are easy to guess");
|
||||
_td("Recent years are easy to guess");
|
||||
_td("Dates are often easy to guess");
|
||||
|
@ -73,8 +70,8 @@ export function scorePassword(password: string) {
|
|||
|
||||
let zxcvbnResult = zxcvbn(password, userInputs);
|
||||
// Work around https://github.com/dropbox/zxcvbn/issues/216
|
||||
if (password.includes(' ')) {
|
||||
const resultNoSpaces = zxcvbn(password.replace(/ /g, ''), userInputs);
|
||||
if (password.includes(" ")) {
|
||||
const resultNoSpaces = zxcvbn(password.replace(/ /g, ""), userInputs);
|
||||
if (resultNoSpaces.score < zxcvbnResult.score) zxcvbnResult = resultNoSpaces;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue