From e98337a5f0d0e1640016b685341264d9e552b4bb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 5 Oct 2022 12:38:06 -0700 Subject: handle login/registration errors --- src/lib/utils.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib') diff --git a/src/lib/utils.js b/src/lib/utils.js index baf2176d..65d42ffb 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -98,6 +98,7 @@ export const info = (m) => { export const login = async (user, cookies) => { let maxAge = 30 * 24 * 60 * 60; let { token } = await post('/login', user); + if (!token) throw new Error("Login failed"); let expires = new Date(); expires.setSeconds(expires.getSeconds() + maxAge); -- cgit v1.2.3