diff options
| author | Adam Soltys <[email protected]> | 2023-01-06 12:23:40 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-06 12:23:40 -0800 |
| commit | 46e33eb5ba63276836322b11abfbff6432c98ff6 (patch) | |
| tree | 64c1ad3760ed5c6c5f86dda8a0ec624197a75ab1 /src/lib/utils.js | |
| parent | e398ccf8b21e38c5fd0bc445acce4d6542551713 (diff) | |
| download | coinos-ui-46e33eb5ba63276836322b11abfbff6432c98ff6.tar.gz coinos-ui-46e33eb5ba63276836322b11abfbff6432c98ff6.zip | |
re-encrypt entropy on password change
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js index d7fba2fc..77ed93bd 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -46,12 +46,12 @@ export const post = (url, body, headers) => { if (r.ok) return r.text(); let text = await r.text(); - let message; + let message; try { ({ message } = JSON.parse(text)); } catch (e) {} - if (message) throw new Error(message); + if (message) throw new Error(message); throw new Error(text); }) .then((body) => { @@ -83,7 +83,14 @@ export function reverseFormat(val, locale) { return Number.isNaN(reversedVal) ? 0 : +reversedVal; } -export let protectedRoutes = [/customers/, /dashboard/, /settings/, /transactions/, /\/ln\//, /request/]; +export let protectedRoutes = [ + /customers/, + /dashboard/, + /settings/, + /transactions/, + /\/ln\//, + /request/ +]; export const success = (m) => { toast.pop(); |
