add: login

This commit is contained in:
trisua 2025-08-24 17:04:27 -04:00
parent ce9ce4f635
commit 8c86dd6cda
13 changed files with 407 additions and 25 deletions

View file

@ -345,7 +345,7 @@ input {
input:not([type="checkbox"]):focus {
outline: solid 2px var(--color-primary);
box-shadow: 0 0 0 4px oklch(87% 0.065 274.039 / 25%);
box-shadow: 0 0 0 4px oklch(70.5% 0.213 47.604 / 25%);
background: var(--color-super-raised);
}
@ -450,19 +450,14 @@ code:not(pre *):not(.dark *) {
svg.icon {
stroke: currentColor;
fill: currentColor;
width: 18px;
height: 1em;
}
svg.icon.filled {
.filled svg.icon {
fill: currentColor;
}
.no_fill svg.icon {
fill: transparent;
}
button svg {
pointer-events: none;
}

24
app/public/tokens.js Normal file
View file

@ -0,0 +1,24 @@
globalThis.LOGIN_ACCOUNT_TOKENS = JSON.parse(
window.localStorage.getItem("login_account_tokens") || "[]",
);
function save_login_account_tokens() {
window.localStorage.setItem(
"login_account_tokens",
JSON.stringify(LOGIN_ACCOUNT_TOKENS),
);
}
function user_logout() {
if (!confirm("Are you sure you would like to do this?")) {
return;
}
fetch("/api/v1/auth/logout", { method: "POST" })
.then((res) => res.json())
.then((res) => {
if (res.ok) {
window.location.href = "/";
}
});
}