add: user account switcher

This commit is contained in:
trisua 2025-04-03 22:36:58 -04:00
parent 48e0b02198
commit 20aae5570b
13 changed files with 172 additions and 34 deletions

View file

@ -48,6 +48,12 @@
]);
if (res.ok) {
// update tokens
const new_tokens = ns("me").LOGIN_ACCOUNT_TOKENS;
new_tokens[e.target.username.value] = res.message;
trigger("me::set_login_account_tokens", [new_tokens]);
// redirect
setTimeout(() => {
window.location.href = "/";
}, 150);

View file

@ -100,6 +100,12 @@
]);
if (res.ok) {
// update tokens
const new_tokens = ns("me").LOGIN_ACCOUNT_TOKENS;
new_tokens[e.target.username.value] = res.message;
trigger("me::set_login_account_tokens", [new_tokens]);
// redirect
setTimeout(() => {
window.location.href = "/";
}, 150);