renamed header.

pull/232/head
Nils Kenneweg 11 years ago
parent 14d10b760d
commit e1341b3a31
  1. 4
      app/assets/javascripts/application.js
  2. 2
      app/controllers/application_controller.rb

@ -52,7 +52,7 @@ if (typeof []._reverse == 'undefined') {
}
jQuery(document).ajaxError(function(event, request, settings) {
if (request.status === 401 && /Reason: login needed/.match(request.getAllResponseHeaders())) {
if (request.status === 401 && /X-Reason: login needed/.match(request.getAllResponseHeaders())) {
if (confirm(I18n.t("js.logoff") + "\r\n" + I18n.t("js.redirect_login"))) {
location.href = openProject.loginUrl + "?back_url=" + encodeURIComponent(location.href);
}
@ -506,7 +506,7 @@ document.observe("dom:loaded", function() {
}
},
onComplete: function(request, result){
if (result.status === 401 && /Reason: login needed/.match(result.getAllResponseHeaders())) {
if (result.status === 401 && /X-Reason: login needed/.match(result.getAllResponseHeaders())) {
if (confirm(I18n.t("js.logoff") + "\r\n" + I18n.t("js.redirect_login"))) {
location.href = openProject.loginUrl + "?back_url=" + encodeURIComponent(location.href);
}

@ -207,7 +207,7 @@ class ApplicationController < ActionController::Base
end
format.any(:xml, :js, :json) {
head :unauthorized,
"Reason" => "login needed",
"X-Reason" => "login needed",
'WWW-Authenticate' => authentication_scheme + ' realm="OpenProject API"'
}
end

Loading…
Cancel
Save