fix: untrusted server login showed raw error
Massimo Melina committed
Jul 24, 2026 at 00:00 UTC
c8389bf4301742e6aed996afa67645007342419e
1 file changed
+1
-1
frontend/src/login.ts
+1
-1
@@ -29,7 +29,7 @@ async function login(username:string, password:string, extra?: object) {
29
return res
30
}, err => {
31
hfsEvent('loginFailed', { username, error: err }) // the name inconsistency with the backend event 'failedLogin' can make it easier to distinguish
32
- throw Error(err.data === 'trust' ? t('login_untrusted', "Login aborted: server identity cannot be trusted")
32
+ throw Error(err === 'trust' ? t('login_untrusted', "Login aborted: server identity cannot be trusted")
33
: err.code === HTTP_UNAUTHORIZED && !err.data ? t('login_bad_credentials', "Invalid credentials") // err.data is empty on standard errors, but a plugin may want to show differently
34
: err.code === HTTP_CONFLICT ? t('login_bad_cookies', "Cookies are not working - login failed")
35
: t(err.message || String(err)) )