Do token filters support value 0?
-
Hello,
I am using Magic Login Pro and would like to create a specific user account whose magic links never expire and can be used multiple times.
According to the documentation, setting:
- Token TTL to
0 - Token Validity to
0
should make the token non-expiring and reusable.
I tried setting these values in the user profile settings, but after saving the user profile and reloading the page, both fields are empty again. So it seems that
0is either not saved correctly or is treated as an empty value / no override.As a workaround, I would like to use the following filters:
add_filter('magic_login_token_ttl_by_user', function ($ttl, $user_id) {
if ((int) $user_id === XXX) {
return 0;
}
return $ttl;
}, 10, 2);
add_filter('magic_login_token_validity_by_user', function ($validity, $user_id) {
if ((int) $user_id === XXX) {
return 0;
}
return $validity;
}, 10, 2);Could you please confirm whether both filters are supposed to respect the value
0?In particular:
- Does
magic_login_token_ttl_by_usersupport returning0to make the token never expire? - Does
magic_login_token_validity_by_usersupport returning0to allow unlimited usage? - Is it expected that
0cannot be saved in the per-user settings, or could this be a bug?
Thank you!
- Token TTL to
You must be logged in to reply to this topic.