From 46e33eb5ba63276836322b11abfbff6432c98ff6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 6 Jan 2023 12:23:40 -0800 Subject: re-encrypt entropy on password change --- src/lib/utils.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/lib/utils.js') 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(); -- cgit v1.2.3