Skip to content

Instantly share code, notes, and snippets.

@sbkinney
Forked from anonymous/gist:6998140
Last active December 25, 2015 15:29
Show Gist options
  • Save sbkinney/6998155 to your computer and use it in GitHub Desktop.
Save sbkinney/6998155 to your computer and use it in GitHub Desktop.
Code snippet for Help Center that allows for forced redirect to the login page if the current user is anonymous/unauthenticated.
$(document).ready(function() {
if(HelpCenter.user.role === "anonymous") {
window.location.replace("/access/unauthenticated?return_to=" + encodeURIComponent(window.location.pathname) + "&theme=hc");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment