Skip to content
Snippets Groups Projects
Commit 20fcd205 authored by Shane Tomlinson's avatar Shane Tomlinson
Browse files

If the user has cookies disabled, automatically show the content for non-authenticated users.

issue #1201
issue #1202
parent fdb2a3c7
No related branches found
No related tags found
No related merge requests found
......@@ -70,21 +70,35 @@ $(function() {
});
var ANIMATION_TIME = 500;
user.checkAuthentication(function(authenticated) {
$(".display_always").fadeIn(ANIMATION_TIME);
dom.addClass("body", authenticated ? "authenticated" : "not_authenticated");
if (authenticated) {
$(".display_auth").fadeIn(ANIMATION_TIME);
if ($('#emailList').length) {
bid.manageAccount();
}
network.cookiesEnabled(function(cookiesEnabled) {
if(cookiesEnabled) {
user.checkAuthentication(function(authenticated) {
if (authenticated) {
displayAuthenticated();
}
else {
displayNonAuthenticated();
}
});
}
else {
$(".display_nonauth").fadeIn(ANIMATION_TIME);
displayNonAuthenticated();
}
});
function displayAuthenticated() {
$(".display_always").fadeIn(ANIMATION_TIME);
dom.addClass("body", "authenticated");
$(".display_auth").fadeIn(ANIMATION_TIME);
if ($('#emailList').length) {
bid.manageAccount();
}
}
function displayNonAuthenticated() {
$(".display_always").fadeIn(ANIMATION_TIME);
dom.addClass("body", "not_authenticated");
$(".display_nonauth").fadeIn(ANIMATION_TIME);
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment