gourami icon indicating copy to clipboard operation
gourami copied to clipboard

Show validation errors on registration form

Open wezm opened this issue 4 years ago • 1 comments

When registering a new account on a local development instance the registration kept failing for me. Eventually I poked through the code and found that a password complexity check is performed and my test password of password was unsurprisingly too weak.

The code in question is as follows from do_register in lib.rs:

    if form.validate().is_err() {
        // TODO catch better
        return do_login(LoginForm {
            username: form.username,
            password: form.password,
        });
    }

I note the TODO is already there but figured it was worth extracting it to an issue for tracking.

wezm avatar Jun 01 '20 02:06 wezm

Thanks for the bug report! This is on my TODO for sure -- the code around error handling is a bit sloppy and I'll have to fix it a bit to resolve this. I also feel somewhat ambivalent about using the zxcvbn library, simply because I'm trying to limit dependencies. I will probably resolve this in a batch with some other error reporting stuff

alexwennerberg avatar Jun 01 '20 05:06 alexwennerberg