diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-19 23:17:05 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-19 23:17:05 -0500 |
| commit | 0805b9a105f6cb12ffb23349e1458d13ffd90d4f (patch) | |
| tree | b3ae97ace949963b0e6d9ae1df6be74046f5fd12 /StoneIsland/www/js/sdk/auth.js | |
| parent | eac52234321adbbb0c97c0bfedf4c7bcc64d7397 (diff) | |
dates and some cart auth
Diffstat (limited to 'StoneIsland/www/js/sdk/auth.js')
| -rw-r--r-- | StoneIsland/www/js/sdk/auth.js | 10 |
1 files changed, 10 insertions, 0 deletions
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 = "" |
