summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/sdk/auth.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-19 23:17:05 -0500
committerJules Laplace <jules@okfoc.us>2015-11-19 23:17:05 -0500
commit0805b9a105f6cb12ffb23349e1458d13ffd90d4f (patch)
treeb3ae97ace949963b0e6d9ae1df6be74046f5fd12 /StoneIsland/www/js/sdk/auth.js
parenteac52234321adbbb0c97c0bfedf4c7bcc64d7397 (diff)
dates and some cart auth
Diffstat (limited to 'StoneIsland/www/js/sdk/auth.js')
-rw-r--r--StoneIsland/www/js/sdk/auth.js10
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 = ""