diff options
| author | Adam Soltys <[email protected]> | 2022-10-05 12:38:06 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-05 12:38:06 -0700 |
| commit | c126830e9188182c46ced319b2295c545cf7547e (patch) | |
| tree | f03d56702de5ed69afc352055c8a20c02d62669f /src/lib/utils.js | |
| parent | 4e19fee6b1f28f6c638fbe91e985426075b04864 (diff) | |
| download | coinos-ui-c126830e9188182c46ced319b2295c545cf7547e.tar.gz coinos-ui-c126830e9188182c46ced319b2295c545cf7547e.zip | |
handle login/registration errors
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 1 |
1 files changed, 1 insertions, 0 deletions
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); |
