logo

Stop storing JWT in LocalStorage! And stop using JWT.

I’ve been developing single-page web-apps for a while now, and it’s gotten into my habit to use LocalStorage to store JWTs. The reason I used JWT was to embed data about the user, and keep it on the client-side, to authenticate (identify) requests/users. Figured out a while ago that it was wrong. On many levels! TL;DR — don’t use JWT and don’t store sensitive data in LocalStorage For starters, it’s not okay to store auth data in LocalStorage.

Read more →

Reading BigInt in Chrome, how to handle big numbers in JavaScript & CSS architecture

/ Reading list

Numerous battles have been carried out by developers with JavaScript’s Math. Today, I found some big news on the web, about BigInt landing in V8. Mathias Bynens — BigInt: arbitrary-precision integers in JavaScript Adding BigInts to V8 Source Code — v8/src/objects/bigint.h It’s not going to rid us of BigNumber.js just yet, but it’s probably going to serve as the starting point for implementing BigDecimal. Currently, there are a dozen variants to handle big numbers in JavaScript without touching Math, ranging from keeping the numbers as strings to keeping the integer part and the fraction as separate strings in an array and join them together at a later time to using third party libraries which more or less use the same strategies I mentioned before.

Read more →
Copyright (c) 2023 Adrian Oprea. All rights reserved.