Strip non-alphanumeric characters before parsing ForgotPasswordKey
1 files changed, 2 insertions(+), 0 deletions(-) M src/routes/api/forgot_password.rs
M src/routes/api/forgot_password.rs => src/routes/api/forgot_password.rs +2 -0
@@ 32,6 32,8 @@ impl std::str::FromStr for ForgotPasswordKey { type Err = bs58::decode::Error; fn from_str(src: &str) -> Result<Self, Self::Err> { + let src = src.trim_matches(|c: char| !c.is_alphanumeric()); + let mut buf = [0; 4]; bs58::decode(src).into(&mut buf)?; Ok(Self {