X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=navigator.gssweb.js;h=3027f976dbcff0afdc8a850407200b9d8af566d9;hb=a4f5da4d2271bd35d3f4e96bae3bf7c9594beabb;hp=0ff0f137352eb85ec96990a0e35027051e47fc34;hpb=8ba88f10f8bef6440e58409db7ceee45baef6b56;p=gssweb.git diff --git a/navigator.gssweb.js b/navigator.gssweb.js index 0ff0f13..3027f97 100644 --- a/navigator.gssweb.js +++ b/navigator.gssweb.js @@ -68,7 +68,7 @@ var GSSWeb = (function () { GSSWeb.prototype.authGetServerName = function () { this.gss.import_name({ - name: "HTTP@" + window.location.host, + name: "HTTP@" + window.location.hostname, success: this.authReceiveServerName.bind(this) }); }; @@ -153,11 +153,10 @@ var GSSWeb = (function () { return; } - var serverResponse = JSON.parse(this.xhr.responseText); - this.serverToken = serverResponse.gssweb.token; switch (this.xhr.status) { case 200: // Finished! + var serverResponse = JSON.parse(this.xhr.responseText); var decoded = window.atob(serverResponse.application.data); this.authenticationState = true; this.success( @@ -168,12 +167,14 @@ var GSSWeb = (function () { break; case 401: // Continue needed + var serverResponse = JSON.parse(this.xhr.responseText); + this.serverToken = serverResponse.gssweb.token; this.authInitSecContext(); break; default: // We have some server-reported error this.error( - window.location.host + + window.location.hostname + " reported an error; aborting", this.appTag );