Some of our users wanted to have an option to force users to sign-in before they can upvote.
The code below does exactly that (it needs to be added to the list’s page custom code header area)
<script>
/** Force users to signin before upvote click **/
document.addEventListener("DOMContentLoaded", function () {
/** You might need to change the 'signin' with your own signin page path **/
const signinPageUrl = window.location.host + '/signin';
if(!window.logged_in_user || !window.logged_in_user['softr_user_email']) {
$('.sw-js-upvote-button').unbind('click');
$('.sw-js-upvote-button').click(function(event){
window.location.href = signinPageUrl;
});
}
});
<script>