I swear there is a tutorial running around related to using a token as an extra layer of security for views…can someone point me in the right direction?
Looking for something quick so I don’t have to reinvent the wheel.
I found it on our Facebook group! Here it is for anyone else:
https://www.techmavenconsulting.com/2022/06/22/formidable-pro-secure-data/?fbclid=IwAR20eB_ctMLt5eyiTc5NIOXHBBZjnO6Z-kH6u72NjeveFWELuD0jPZtwPAs&mibextid=Zxz2cZ
Anyone find anything wrong with this code?
<script> const random = (length = 8) => { // Declare all characters let chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; //Pick characters randomly let str = ''; for (let i = 0; i < length; i++) { str += chars.charAt(Math.floor(Math.random() * chars.length)); } return str; if(!jQuery('#field_entrytoken').val()){ jQuery('#field_entrytoken').val(random(20)); //Change 20 to any numerical value you want for the amount of characters to apply to the "Entry Token". The more characters that you use, the less likely it will be cracked } } </script>
Its not populating a token in the field, is why I am having yall look at it.
Please login or Register to submit your answer
I’m pretty sure it’s Bobby’s.
That’s what I thought, I just can’t find it 😤