Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32386362
D6095.1765333523.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
871 B
Referenced Files
None
Subscribers
None
D6095.1765333523.diff
View Options
diff --git a/lib/shared/account-utils.js b/lib/shared/account-utils.js
--- a/lib/shared/account-utils.js
+++ b/lib/shared/account-utils.js
@@ -7,6 +7,7 @@
import type { AppState } from '../types/redux-types';
import type { PreRequestUserState } from '../types/session-types';
import type { CurrentUserInfo } from '../types/user-types';
+import { isValidEthereumAddress } from '../utils/siwe-utils';
const usernameMaxLength = 191;
const usernameMinLength = 1;
@@ -74,6 +75,12 @@
);
}
+function accountHasPassword(currentUserInfo: ?CurrentUserInfo): boolean {
+ return currentUserInfo?.username
+ ? !isValidEthereumAddress(currentUserInfo.username)
+ : false;
+}
+
export {
usernameMaxLength,
oldValidUsernameRegexString,
@@ -83,4 +90,5 @@
invalidSessionDowngrade,
invalidSessionRecovery,
validHexColorRegex,
+ accountHasPassword,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 10, 2:25 AM (12 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5858649
Default Alt Text
D6095.1765333523.diff (871 B)
Attached To
Mode
D6095: Implement function to check whether account has password - currently checking for ethereum validity
Attached
Detach File
Event Timeline
Log In to Comment