Topic-icon "Remember me" broken in combination with OTP

Active Subscriptions:

None
7 years 10 months ago - 7 years 10 months ago #64360 by vincent
Hi!

It seems that the "Remember Me" option is broken on the modal login popup in combination with OTP.
If I check the javascript there is nothing that actually copies the state of the checkbox for submission. Unlike the username/password field that are copied to hidden fields.

Thanks
Last edit: 7 years 10 months ago by vincent.
The topic has been locked.
Support Specialist
7 years 10 months ago #64364 by alzander
Vincent,
Thanks for pointing that out. From a quick check, you're right that we're not copying that value over. I haven't tested this yet, but it seems like adding the following code to the /media/sourcecoast/mod_sclogin.js file, around line 45, should do the trick:
var rememberField = jfbcJQuery(formId + ' :input[name=remember]').eq(0).clone(true);
                    rememberField.attr('type', 'hidden');
                    jfbcJQuery(otpForm).find("form").append(rememberField);
I believe that will work if the Remember Me field is set to show, but will break OTP if the field is not set to show. We'll have to do some testing with it in general, but would love to hear your feedback if that gets things going for you.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
7 years 10 months ago #64373 by vincent
Hi Alex,

The javascript your provided does function, but, since you don't provide a value for the remember me checkbox in the login form, it wil copy it with an empty value. And thus it doesn't work ;)

But beware, if you supply a value to the remember me checkbox (value should be 'yes' in Joomla) and use the javascript you provided, it will always copy the value to the hidden field, no matter if the checkbox was checked or not and everybody will be remembered. So should be some other implementation.

Thanks,
Vincent
The topic has been locked.