Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Invalidate the server login when a 401 is received

  • Loading branch information...
commit 3646d66db4a60e1aec6ed6ef591c3cb72ee4bf34 1 parent adb5077
Ian Bicking ianb authored
Showing with 14 additions and 0 deletions.
  1. +1 −0  addons/jetpack/lib/sync.js
  2. +13 −0 sync/tests/scheduler.html
1  addons/jetpack/lib/sync.js
View
@@ -762,6 +762,7 @@ Server.prototype.isSaneRetryAfter = function (val) {
Server.prototype.checkAuthRequest = function (req) {
if (req.status === 401 && this.onautherror) {
+ this.logout();
this.onautherror();
}
};
13 sync/tests/scheduler.html
View
@@ -165,6 +165,19 @@
Poll: 300000 -270000
</pre>
+Next, we'll give a quick try at triggering logout/auth:
+
+<pre class="doctest">
+$ writeln(service.loggedIn());
+true
+$ override('__testing__', {status: 401});
+Completed
+$ get();
+...
+$ writeln(service.loggedIn());
+false
+</pre>
+
</div>
</body> </html>
Please sign in to comment.
Something went wrong with that request. Please try again.