Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix .expire() method for ending sessions

  • Loading branch information...
commit c0c56e8e801b596c94ac1fce15008ee148fc329c 1 parent 3971323
@patrickarlt patrickarlt authored
View
6 source/geoloqi-client.js
@@ -150,7 +150,7 @@ var geoloqi = (function () {
function expire() {
exports.auth = null;
- util.cookie.erase();
+ util.session.destroy();
}
exports.expire = expire;
@@ -368,9 +368,9 @@ var geoloqi = (function () {
return JSON.parse(localStorage.getItem(cookieName));
};
exports.get = get;
-
+
function erase(){
- set("");
+ localStorage.removeItem(cookieName);
};
exports.erase = erase;
View
4 spec/javascripts/client_spec.js
@@ -98,14 +98,14 @@ describe("Geoloqi Client Authentication", function() {
});
waitsFor(function(){
- return geoloqi.auth;
+ return geoloqi.logged_in();
}, "authentication with username and password timeout", 1000);
runs(function(){
geoloqi.expire();
expect(geoloqi.logged_in()).toBeFalsy(false);
expect(document.cookie).toBeFalsy();
- expect(localStorage.getItem("_geoloqi.auth")).toBeFalsy();
+ expect(localStorage.getItem("_geoloqi_auth")).toBeFalsy();
});
});
View
8 spec/javascripts/support/jasmine.yml
@@ -11,10 +11,10 @@
# - dist/**/*.js
#
src_files:
-# - source/easyXDM/json2.min.js
-# - source/easyXDM/easyXDM.min.js
-# - source/geoloqi-client.js
- - geoloqi.min.js
+ - source/easyXDM/json2.min.js
+ - source/easyXDM/easyXDM.min.js
+ - source/geoloqi-client.js
+# - geoloqi.min.js
# stylesheets
#
Please sign in to comment.
Something went wrong with that request. Please try again.