Commit b4a1f3b9ff69433ffe395678dfa8d97fa771e5a7
Committed by
Gabriela Navarro
1 parent
176093a3
Exists in
master
and in
29 other branches
Fix homepage button to keep user looged in at application.js
Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
1 changed file
with
3 additions
and
5 deletions
Show diff stats
public/javascripts/application.js
... | ... | @@ -523,8 +523,10 @@ function userDataCallback(data) { |
523 | 523 | if (data.login) { |
524 | 524 | // logged in |
525 | 525 | if (data.chat_enabled) { |
526 | - setInterval(function(){ $.getJSON(user_data, chatOnlineUsersDataCallBack)}, 10000); | |
526 | + setInterval(function(){ jQuery.getJSON(user_data, chatOnlineUsersDataCallBack)}, 10000); | |
527 | 527 | } |
528 | + jQuery('head').append('<meta content="authenticity_token" name="csrf-param" />'); | |
529 | + jQuery('head').append('<meta content="'+jQuery.cookie("_noosfero_.XSRF-TOKEN")+'" name="csrf-token" />'); | |
528 | 530 | } |
529 | 531 | if (data.notice) { |
530 | 532 | display_notice(data.notice); |
... | ... | @@ -546,10 +548,6 @@ jQuery(function($) { |
546 | 548 | |
547 | 549 | var user_data = noosfero_root() + '/account/user_data'; |
548 | 550 | $.getJSON(user_data, userDataCallback) |
549 | - if (user_data.login) { | |
550 | - $('head').append('<meta content="authenticity_token" name="csrf-param" />'); | |
551 | - $('head').append('<meta content="'+$.cookie("_noosfero_.XSRF-TOKEN")+'" name="csrf-token" />'); | |
552 | - } | |
553 | 551 | |
554 | 552 | $.ajaxSetup({ cache: false }); |
555 | 553 | ... | ... |