diff --git a/browserid.js b/browserid.js
index 9d3ac8a..8fbcaa2 100644
--- a/browserid.js
+++ b/browserid.js
@@ -39,8 +39,6 @@
// script is run. Attach a live event (yuck) so that the user is still
// able to log out.
liveEvent(".js-persona__logout", "click", function(event) {
- event.preventDefault();
-
ignoreLogout = false;
navigator.id.logout();
});
@@ -207,13 +205,6 @@
// the user leaving a comment but not being logged in. Either way,
// do not redirect the user, they are where they want to be.
if (ignoreLogout) return;
-
- // There is a bug in Persona with Chrome. When a user signs in, the
- // onlogout callback is first fired. Check if a user is actually
- // signed in before redirecting to the logout URL.
- if (browserid_common.loggedInUser) {
- document.location = browserid_common.urlLogoutRedirect;
- }
}
});
diff --git a/browserid.min.js b/browserid.min.js
index 2e8d9ab..29b20cb 100644
--- a/browserid.min.js
+++ b/browserid.min.js
@@ -1 +1 @@
-/*jshint browser: true*//*global browserid_common, jQuery*/(function(){function i(a){return a||"login"}function j(a){b=a;var c={siteName:browserid_common.siteName||"",siteLogo:browserid_common.siteLogo||"",backgroundColor:browserid_common.backgroundColor||"",termsOfService:browserid_common.termsOfService||"",privacyPolicy:browserid_common.privacyPolicy||""};b==="comment"?c.returnTo=u("#submit_comment"):b==="register"&&(c.returnTo=u("#submit_registration")),navigator.id.request(c)}function k(b){var c=document.getElementById("rememberme");c!==null&&(c=c.checked);var d=document.createElement("form");d.setAttribute("style","display: none;"),d.method="POST",d.action=browserid_common.urlLoginSubmit;var e={browserid_assertion:b,rememberme:c};browserid_common.urlLoginRedirect!==null&&(e.redirect_to=browserid_common.urlLoginRedirect),v(d,e),a("body").append(d),d.submit()}function l(){d=!0,n(),j("comment")}function m(b){var e=o();if(!e&&!c)return p();var g=a("#commentform"),h=a("#comment_post_ID").val();v(g,{browserid_comment:h,browserid_assertion:b}),localStorage.removeItem("comment_hash"),sessionStorage.setItem("submitting_comment","true"),browserid_common.loggedInUser||(d=!0,navigator.id.logout()),f=!0,a("#submit").click()}function n(){var b={author:a("#author").val(),url:a("#url").val(),comment:a("#comment").val(),comment_parent:a("#comment_parent").val()};localStorage.setItem("comment_state",JSON.stringify(b))}function o(){var b=localStorage.getItem("comment_state");return b&&(b=JSON.parse(b),a("#author").val(b.author),a("#url").val(b.url),a("#comment").val(b.comment),a("#comment_parent").val(b.comment_parent),localStorage.removeItem("comment_state")),b}function p(){var a=localStorage.getItem("comment_hash");a?(localStorage.removeItem("comment_hash"),document.location.hash=a,document.location.reload(!0)):setTimeout(p,100)}function q(b){var d=s();if(!d&&!c)return t();sessionStorage.setItem("submitting_registration","true"),a("#browserid_assertion").val(b),e=!0,a("#wp-submit").click()}function r(){var b={user_login:a("#user_login").val()};localStorage.setItem("registration_state",JSON.stringify(b))}function s(){var b=localStorage.getItem("registration_state");return b&&(b=JSON.parse(b),a("#user_login").val(b.user_login),localStorage.removeItem("registration_state")),b}function t(){var a=localStorage.getItem("registration_complete");a?(localStorage.removeItem("registration_complete"),document.location=browserid_common.urlRegistrationRedirect):setTimeout(t,100)}function u(a){return document.location.href.replace(/http(s)?:\/\//,"").replace(document.location.host,"").replace(/#.*$/,"")+a}function v(b,c){b=a(b);for(var d in c){var e=document.createElement("input");e.type="hidden",e.name=d,e.value=c[d],b.append(e)}}function w(){var b=a("
");a("body").append(b)}function x(b,c){function d(){var d=a(b).val();d&&d.trim().length?a(c).removeClass("disabled"):a(c).addClass("disabled")}a(c).addClass("disabled"),a(b).keyup(d),a(b).change(d)}function y(b,c,d){a("body")[typeof a.fn.on=="function"?"on":"delegate"](c,b,d)}"use strict";var a=jQuery,b,c,d=!1,e=!1,f=browserid_common.loggedInUser||!1,g;a(".js-persona__login").click(function(a){a.preventDefault(),d=!1,j("login")}),y(".js-persona__logout","click",function(a){a.preventDefault(),d=!1,navigator.id.logout()}),browserid_common.isPersonaUsedWithComments&&(a("body").addClass("persona--comments"),a(".js-persona__submit-comment").click(function(b){b.preventDefault(),a("#commentform").submit()}),a("#commentform").submit(function(b){if(a("#comment").hasClass("disabled")){b.preventDefault();return}f||(b.preventDefault(),l())})),browserid_common.isPersonaOnlyAuth&&(a("body").addClass("persona--persona-only-auth"),x("#user_login",".js-persona__register"),a(".js-persona__register").click(function(b){b.preventDefault();if(a(b.target).hasClass("disabled"))return;d=!1,r(),j("register")}),a("#registerform").submit(function(b){if(e)return;b.preventDefault();if(a("#user_login").val().length===0)return;d=!1,r(),j("register")}));if(document.location.hash==="#submit_comment"){d=!0,w(),g=o();if(!g)return p();b="comment",c=!0}else if(document.location.hash==="#submit_registration"){d=!0,w(),g=s();if(!g)return t();b="register",c=!0}else document.location.href===browserid_common.urlRegistrationRedirect&&sessionStorage.getItem("submitting_registration")?localStorage.setItem("registration_complete","true"):sessionStorage.getItem("submitting_comment")&&(d=!0,sessionStorage.removeItem("submitting_comment"),localStorage.setItem("comment_hash",document.location.hash));if(browserid_common.msgError||a("#login_error").length)d=!0,navigator.id.logout();var h={login:k,register:q,comment:m};navigator.id.watch({loggedInUser:browserid_common.loggedInUser||null,onlogin:function(a){b=i(b);var c=h[b];c&&c(a)},onlogout:function(){if(d)return;browserid_common.loggedInUser&&(document.location=browserid_common.urlLogoutRedirect)}})})()
\ No newline at end of file
+/*jshint browser: true*//*global browserid_common, jQuery*/(function(){"use strict";function a(e){return e||"login"}function f(e){t=e;var n={siteName:browserid_common.siteName||"",siteLogo:browserid_common.siteLogo||"",backgroundColor:browserid_common.backgroundColor||"",termsOfService:browserid_common.termsOfService||"",privacyPolicy:browserid_common.privacyPolicy||""};t==="comment"?n.returnTo=w("#submit_comment"):t==="register"&&(n.returnTo=w("#submit_registration")),navigator.id.request(n)}function l(t){var n=document.getElementById("rememberme");n!==null&&(n=n.checked);var r=document.createElement("form");r.setAttribute("style","display: none;"),r.method="POST",r.action=browserid_common.urlLoginSubmit;var i={browserid_assertion:t,rememberme:n};browserid_common.urlLoginRedirect!==null&&(i.redirect_to=browserid_common.urlLoginRedirect),E(r,i),e("body").append(r),r.submit()}function c(){r=!0,p(),f("comment")}function h(t){var i=d();if(!i&&!n)return v();var o=e("#commentform"),u=e("#comment_post_ID").val();E(o,{browserid_comment:u,browserid_assertion:t}),localStorage.removeItem("comment_hash"),sessionStorage.setItem("submitting_comment","true"),browserid_common.loggedInUser||(r=!0,navigator.id.logout()),s=!0,e("#submit").click()}function p(){var t={author:e("#author").val(),url:e("#url").val(),comment:e("#comment").val(),comment_parent:e("#comment_parent").val()};localStorage.setItem("comment_state",JSON.stringify(t))}function d(){var t=localStorage.getItem("comment_state");return t&&(t=JSON.parse(t),e("#author").val(t.author),e("#url").val(t.url),e("#comment").val(t.comment),e("#comment_parent").val(t.comment_parent),localStorage.removeItem("comment_state")),t}function v(){var e=localStorage.getItem("comment_hash");e?(localStorage.removeItem("comment_hash"),document.location.hash=e,document.location.reload(!0)):setTimeout(v,100)}function m(t){var r=y();if(!r&&!n)return b();sessionStorage.setItem("submitting_registration","true"),e("#browserid_assertion").val(t),i=!0,e("#wp-submit").click()}function g(){var t={user_login:e("#user_login").val()};localStorage.setItem("registration_state",JSON.stringify(t))}function y(){var t=localStorage.getItem("registration_state");return t&&(t=JSON.parse(t),e("#user_login").val(t.user_login),localStorage.removeItem("registration_state")),t}function b(){var e=localStorage.getItem("registration_complete");e?(localStorage.removeItem("registration_complete"),document.location=browserid_common.urlRegistrationRedirect):setTimeout(b,100)}function w(e){return document.location.href.replace(/http(s)?:\/\//,"").replace(document.location.host,"").replace(/#.*$/,"")+e}function E(t,n){t=e(t);for(var r in n){var i=document.createElement("input");i.type="hidden",i.name=r,i.value=n[r],t.append(i)}}function S(){var t=e("");e("body").append(t)}function x(t,n){function r(){var r=e(t).val();r&&r.trim().length?e(n).removeClass("disabled"):e(n).addClass("disabled")}e(n).addClass("disabled"),e(t).keyup(r),e(t).change(r)}function T(t,n,r){e("body")[typeof e.fn.on=="function"?"on":"delegate"](n,t,r)}var e=jQuery,t,n,r=!1,i=!1,s=browserid_common.loggedInUser||!1,o;e(".js-persona__login").click(function(e){e.preventDefault(),r=!1,f("login")}),T(".js-persona__logout","click",function(e){r=!1,navigator.id.logout()}),browserid_common.isPersonaUsedWithComments&&(e("body").addClass("persona--comments"),e(".js-persona__submit-comment").click(function(t){t.preventDefault(),e("#commentform").submit()}),e("#commentform").submit(function(t){if(e("#comment").hasClass("disabled")){t.preventDefault();return}s||(t.preventDefault(),c())})),browserid_common.isPersonaOnlyAuth&&(e("body").addClass("persona--persona-only-auth"),x("#user_login",".js-persona__register"),e(".js-persona__register").click(function(t){t.preventDefault();if(e(t.target).hasClass("disabled"))return;r=!1,g(),f("register")}),e("#registerform").submit(function(t){if(i)return;t.preventDefault();if(e("#user_login").val().length===0)return;r=!1,g(),f("register")}));if(document.location.hash==="#submit_comment"){r=!0,S(),o=d();if(!o)return v();t="comment",n=!0}else if(document.location.hash==="#submit_registration"){r=!0,S(),o=y();if(!o)return b();t="register",n=!0}else document.location.href===browserid_common.urlRegistrationRedirect&&sessionStorage.getItem("submitting_registration")?localStorage.setItem("registration_complete","true"):sessionStorage.getItem("submitting_comment")&&(r=!0,sessionStorage.removeItem("submitting_comment"),localStorage.setItem("comment_hash",document.location.hash));if(browserid_common.msgError||e("#login_error").length)r=!0,navigator.id.logout();var u={login:l,register:m,comment:h};navigator.id.watch({loggedInUser:browserid_common.loggedInUser||null,onlogin:function(e){t=a(t);var n=u[t];n&&n(e)},onlogout:function(){if(r)return}})})();
\ No newline at end of file
diff --git a/lib/browserid-admin.php b/lib/browserid-admin.php
index 04048a1..6fab714 100644
--- a/lib/browserid-admin.php
+++ b/lib/browserid-admin.php
@@ -96,7 +96,7 @@ public function Admin_toolbar_replace_logout_action($wp_toolbar) {
'id' => 'logout',
'title' => $this->logout_html,
'parent' => 'user-actions',
- 'href' => '#',
+ 'href' => wp_logout_url(),
'meta' => array(
'class' => 'js-persona__logout'
)