From aab0b4857b341f4b63c5c7e8d7746bab41a1df7e Mon Sep 17 00:00:00 2001
From: Ben Adida <ben@adida.net>
Date: Mon, 4 Jun 2012 15:05:11 -0700
Subject: [PATCH] when obtaining an assertion silently, still make sure that
 expired certs are cleaned up.

---
 resources/static/shared/user.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/resources/static/shared/user.js b/resources/static/shared/user.js
index 167948840..2c3752a41 100644
--- a/resources/static/shared/user.js
+++ b/resources/static/shared/user.js
@@ -696,8 +696,7 @@ BrowserID.User = (function() {
      * @param {function} [onFailure] - Called on error.
      */
     checkAuthenticationAndSync: function(onComplete, onFailure) {
-      network.checkAuth(function(authenticated) {
-        setAuthenticationStatus(authenticated);
+      User.checkAuthentication(function(authenticated) {
         if (authenticated) {
           User.syncEmails(function() {
             onComplete && onComplete(authenticated);
@@ -1065,7 +1064,7 @@ BrowserID.User = (function() {
       //      so if we rely on localstorage only and check authentication status
       //      only when we know a network request will be required, we very well
       //      might have fewer race conditions and do fewer network requests.
-      User.checkAuthentication(function(authenticated) {
+      User.checkAuthenticationAndSync(function(authenticated) {
         if (authenticated) {
           var loggedInEmail = storage.getLoggedIn(origin);
           if (loggedInEmail !== siteSpecifiedEmail) {
-- 
GitLab