Skip to content

Commit

Permalink
fixed localStorage detection for safari
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-k committed Oct 13, 2016
1 parent 545f76d commit 2b37dce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/util/TokenStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ class WebStorage extends TokenStorage {
static isAvailable() {
try {
//firefox throws an exception if cookies are disabled
return typeof localStorage !== 'undefined';
if (typeof localStorage === 'undefined') {
return false;
}

localStorage.setItem('bq_webstorage_test', 'bq');
localStorage.removeItem('bq_webstorage_test');
return true;
} catch (e) {}
return false;
}
Expand Down

0 comments on commit 2b37dce

Please sign in to comment.