diff --git a/frontend/src/views/profile/Security.tsx b/frontend/src/views/profile/Security.tsx index 71ad72f..94f405c 100644 --- a/frontend/src/views/profile/Security.tsx +++ b/frontend/src/views/profile/Security.tsx @@ -71,13 +71,15 @@ function ChangePasswd() { if (pass.pass1 != pass.pass2) return if (load) return setLoad(true) - changePasswd(pass.old, pass.pass1, nowToken).catch(e => { + changePasswd(pass.old, pass.pass1, nowToken) + .then(() => [navigate("/login"), setToken(""), setUser({ name: "", uuid: "" })]) + .catch(e => { if (e instanceof ApiErr && e.code == 6) { setOldPassErr(true) return } setLayoutErr(String(e)) - }).finally(() => setLoad(false)).then(() => [navigate("/login"), setToken(""), setUser({ name: "", uuid: "" })]) + }).finally(() => setLoad(false)) }