()
| 113 | }; |
| 114 | |
| 115 | const getCachedOrNull = () => { |
| 116 | try { |
| 117 | // catch below fallbacks falsy values |
| 118 | return JSON.parse(storage.getItem(BOOT_LOCAL_KEY) as string); |
| 119 | } catch (err) { |
| 120 | return null; |
| 121 | } |
| 122 | }; |
| 123 | |
| 124 | // /boot only reissues a token with under 4 minutes left, so past this margin a |
| 125 | // reissued token means the cached expiry was wrong |