An area/web pages the user has access to after loggin in.
The private pages then all have the following additional bit of Javascript to protect these pages from direct access without having logged in first:
<script>
//Wait for jquery to load before executing code
addEventListener('JqueryLoaded', function(e) {
var readEmail = sessionStorage.getItem('email');
var readToken = sessionStorage.getItem('token');
if (readEmail == "" || readEmail == null || readToken == "" || readToken == null) {
window.location.href = 'login.html';
}
}, false);
</script>
Now I also want to protect the API functions from being accessed by anybody what has not successfully logged into the private area ...