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 | e98337a5f0d0e1640016b685341264d9e552b4bb (patch) | |
| tree | f03d56702de5ed69afc352055c8a20c02d62669f /src/lib/utils.js | |
| parent | c8a9c7ac93f348df23c49776b576dfe25d09878d (diff) | |
| download | coinos-ui-e98337a5f0d0e1640016b685341264d9e552b4bb.tar.gz coinos-ui-e98337a5f0d0e1640016b685341264d9e552b4bb.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); |
