// This code checks if the user has been verified in this session. // It should run on every page you want to protect. (function() { const isVerified = sessionStorage.getItem('is_verified'); // Get the current page's filename const currentPage = window.location.pathname.split('/').pop(); // If the user is NOT verified AND they are not already on the verify.html page... if (isVerified !== 'true' && currentPage !== 'verify.html') { // ...redirect them to the verification page immediately. window.location.href = 'verify.html'; } })();