~vpzom/lotide

bc47e4d34151bfde13e3611d457a216f307356dd — Colin Reeder 2 months ago 27065bc
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 {