Skip to content

Commit ed81dde

Browse files
authored
user lowercase (#3807)
1 parent 53b177d commit ed81dde

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

parachain/primitives/src/identity.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,12 @@ impl Identity {
467467
},
468468
Identity::Apple(handle) => {
469469
hasher.update(b"apple");
470-
hasher.update(String::from_utf8(handle.inner.to_vec()).unwrap_or_default());
470+
hasher.update(
471+
String::from_utf8(handle.inner.to_vec())
472+
.unwrap_or_default()
473+
.to_lowercase()
474+
.as_bytes(),
475+
);
471476
},
472477
Identity::Email(handle) => {
473478
hasher.update(b"email");
@@ -480,7 +485,12 @@ impl Identity {
480485
},
481486
Identity::Google(handle) => {
482487
hasher.update(b"google");
483-
hasher.update(String::from_utf8(handle.inner.to_vec()).unwrap_or_default());
488+
hasher.update(
489+
String::from_utf8(handle.inner.to_vec())
490+
.unwrap_or_default()
491+
.to_lowercase()
492+
.as_bytes(),
493+
);
484494
},
485495
Identity::Pumpx(handle) => {
486496
// TODO: this type will be removed.
@@ -489,7 +499,12 @@ impl Identity {
489499
},
490500
Identity::Passkey(handle) => {
491501
hasher.update(b"passkey");
492-
hasher.update(String::from_utf8(handle.inner.to_vec()).unwrap_or_default());
502+
hasher.update(
503+
String::from_utf8(handle.inner.to_vec())
504+
.unwrap_or_default()
505+
.to_lowercase()
506+
.as_bytes(),
507+
);
493508
},
494509
}
495510

0 commit comments

Comments
 (0)