-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update password to be at least 8 characters
Add description that emojis are supported. Update minimum password length for reset password popup add password utility Update onboarding and reset password views to share password checking code
- Loading branch information
Showing
5 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(ns status-im.utils.password-resources | ||
(:require [status-im.constants :as const])) | ||
|
||
(defn to-numbers [vals] | ||
(map int vals)) | ||
|
||
(defn diff [vals] | ||
(map - (next vals) vals)) | ||
|
||
(defn is-same? [a b] | ||
(= a b)) | ||
|
||
(defn all-same? [word] | ||
(let [first-letter (first word)] | ||
(every? #{first-letter} word))) | ||
|
||
(defn is-sequential? [sequence] | ||
(all-same? (diff (to-numbers sequence)))) | ||
|
||
(defn validate-password [password] | ||
(and (>= (count password) const/min-password-length) | ||
(not (all-same? password)))) | ||
|
||
(defn confirm-password [password confirm] | ||
(= password confirm)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters