Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Password Policy module relies on a custom menu callback, custom javascript, and reads $_POST directly.
Instead, we should explore using Drupal's #ajax API.
Comment | File | Size | Author |
---|---|---|---|
#2 | password_policy-ajaxify-2879489-2.patch | 7.66 KB | AaronBauman |
|
Comments
Comment #2
AaronBaumanMy local apache install is getting in the way of testing this.
Let's see what testbot says.
Comment #3
AohRveTPV CreditAttribution: AohRveTPV commentedI plan to review/test this within the next few days.
Comment #4
AohRveTPV CreditAttribution: AohRveTPV commentedBeen reviewing and this looks like a great improvement!
I'm confused by the duplicate Drupal.evaluatePasswordStrength definitions here. Are both actually needed, or just the first?
Comment #5
AohRveTPV CreditAttribution: AohRveTPV commentedThe password changing behavior seems to be different with this patch: Rather than checking after each keypress in the password field, it checks after the password field loses focus.
I think it'd be better to preserve the current behavior if possible with this change, and then if we want to change the checking behavior, we could do that as a separate issue. I'll try to see how we could modify your patch to have the same behavior.
Comment #6
AaronBaumanNo idea why this is in there twice, I was just trying to change as little as possible.
Re preserving current behavior: should be as simple as adding an event item in the #ajax array.
Comment #7
AohRveTPV CreditAttribution: AohRveTPV commentedAh, I see now that your patch didn't introduce that duplication.
Thanks. I'm unfamiliar with the AJAX API. I added a 'keyup' event and it works as before. Except after every keypress, you get a "Please wait..." and spinner, and the browser tab indicates a reload. It's distracting (to me at least), and I wonder if this is why the original authors of this branch didn't use the AJAX API to begin with.
I found a way to get rid of the "Please wait..." and spinner, but I'm not sure there exists a fix for the tab indicating a reload after every keypress. I'll look more into it.
Comment #8
AohRveTPV CreditAttribution: AohRveTPV commentedThe password field also flashes grey upon keyup (disabled?)--distracting.
Sorry if switching to AJAX turns out to have been a bad idea.