Page MenuHomePhabricator

D6095.id20349.diff
No OneTemporary

D6095.id20349.diff

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

Mime Type
text/plain
Expires
Sun, Dec 22, 5:30 AM (11 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690406
Default Alt Text
D6095.id20349.diff (871 B)

Event Timeline