From 0805b9a105f6cb12ffb23349e1458d13ffd90d4f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 19 Nov 2015 23:17:05 -0500 Subject: dates and some cart auth --- StoneIsland/www/js/sdk/auth.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'StoneIsland/www/js/sdk/auth.js') diff --git a/StoneIsland/www/js/sdk/auth.js b/StoneIsland/www/js/sdk/auth.js index 548e67f4..5efea20e 100644 --- a/StoneIsland/www/js/sdk/auth.js +++ b/StoneIsland/www/js/sdk/auth.js @@ -42,6 +42,11 @@ var auth = sdk.auth = (function(){ user_id = localStorage.getItem("yoox.user_id") || -1 cb && cb() } + auth.clear_user = function(cb){ + localStorage.removeItem("yoox.access_token") + localStorage.removeItem("yoox.user_id") + cb && cb() + } auth.set_cart = function(cart_id, cart_token, cb){ localStorage.setItem("yoox.cart_token", cart_token) @@ -53,6 +58,11 @@ var auth = sdk.auth = (function(){ cart.id = localStorage.getItem("yoox.cart_id") || -1 cb && cb() } + auth.clear_cart = function(cb){ + localStorage.removeItem("yoox.cart_token") + localStorage.removeItem("yoox.cart_id") + cb && cb() + } auth.log_out = function(){ auth.access_token = "" -- cgit v1.2.3-70-g09d2