aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-01-06 12:23:40 -0800
committerAdam Soltys <[email protected]>2023-01-06 12:23:40 -0800
commit46e33eb5ba63276836322b11abfbff6432c98ff6 (patch)
tree64c1ad3760ed5c6c5f86dda8a0ec624197a75ab1 /src/lib/utils.js
parente398ccf8b21e38c5fd0bc445acce4d6542551713 (diff)
downloadcoinos-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.js13
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();