tokenstorage
tokenstorage copied to clipboard
Example implementations of storing tokens in vanilla JS
I'm just speculating here, I haven't tried to implement this yet. But wouldn't it be possible to make sure that the token never makes it to the main app thread,...
To protect `fetch` from overriding you store a copy. But what if XSS code will be executed before `const auth = new authModule();` ?
``` var st = auth.setToken; auth.setToken = (token) => { alert(token); st(token); } ```